Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
vicente zavala
Published © LGPL

IoT Face Tracking and Recognition

IoT WiFi face tracking and recognition for Arduino.

AdvancedFull instructions provided7,827
IoT Face Tracking and Recognition

Things used in this project

Hardware components

Arduino Micro
Arduino Micro
×1
SparkFun WiFi Breakout - CC3000
×1
SparkFun SO5NF STD
×1

Software apps and online services

IoT WiFi | Bluetooth Face Tracking + Recognition

Story

Read more

Schematics

ATmega32u4_ServoObjectTracking

Code

ATmega32u4_ServoObjectTracking.ino

Arduino
/*
*	Author		: Zavala Ortiz Vicente Arturo.
*	language	: .ino
*	Date		: Friday April 18 2014.
*	Update		: Friday June  06 2014.
*	Name		: ATmega32u4_ServoObjectTracking.ino
*	Description : Tracks circle coloresd objects
*/
#include <avr/delay.h>

/*		servo libs			*/
#include "_Servo.h"

/*		WiFi libs			*/
#include "CC3000.h"
#include "CC3000_Client.h"
#include "common.h"

Servo servo_x;
Servo servo_y;

void setup()
{
	/* add setup code here */
	ConnectionInfo connection_info;
	
	// Initialize CC3000 (configure SPI communications)
	#ifdef CC3000_DEBUG
		Serial.begin(115200);
	#endif
	
	// Initialize CC3000 (configure SPI communications)
	if(!wifi.init(9)) {
		#ifdef CC3000_DEBUG
		DEBUGPRINTLN(PSTR("Initialize CC3000 FAIL!"));
		#endif
		return;
	}

	else {
		//FreeRam();
		#ifdef CC3000_DEBUG
			DEBUGPRINTLN(PSTR("Initialize CC3000 OK"));
		#endif
	}

	if(!wifi.connect(ap_ssid, ap_security, ap_password, timeout)) 
	{
		#ifdef CC3000_DEBUG
			DEBUGPRINTLN(PSTR("Error: Could not connect to AP!"));
		#endif
	}
	
	
	// Gather connection details and print IP address
	if(!wifi.getConnectionInfo(connection_info) )
	{
		#ifdef CC3000_DEBUG
		DEBUGPRINTLN(PSTR("Error: Could not obtain connection details"));
		#endif
		return;
	}
	
	else
	{
		#ifdef CC3000_DEBUG
		DEBUGPRINT(PSTR("IP Address: "));
		printIPAddr(connection_info.ip_address);
		#endif
	}

	pin_mode(SERVO_PIN_X, OUTPUT);    // declare the LED's pin as output
	pin_mode(SERVO_PIN_Y, OUTPUT);    // declare the LED's pin as output

	servo_x.attach(SERVO_PIN_X);
	servo_y.attach(SERVO_PIN_Y);

	// center servos
	servo_x.write(SERVO_CENTER_X);
	servo_y.write(SERVO_CENTER_Y);

	_delay_ms(200);
}

void loop()
{
	
}

AT32u4_ServoObjectTracking

C/C++
/*
*	Author		: Zavala Ortiz Vicente Arturo.
*	language	: .ino
*	Date		: Friday April 18 2014.
*	Update		: Friday June  06 2014.
*	Name		: ATmega32u4_ServoObjectTracking.ino
*	Description : Tracks circle coloresd objects
*/
#include <avr/delay.h>

/*		servo libs			*/
#include "_Servo.h"

/*		WiFi libs			*/
#include "CC3000.h"
#include "CC3000_Client.h"
#include "common.h"

Servo servo_x;
Servo servo_y;

void setup()
{
	/* add setup code here */
	ConnectionInfo connection_info;
	
	// Initialize CC3000 (configure SPI communications)
	#ifdef CC3000_DEBUG
		Serial.begin(115200);
	#endif
	
	// Initialize CC3000 (configure SPI communications)
	if(!wifi.init(9)) {
		#ifdef CC3000_DEBUG
		DEBUGPRINTLN(PSTR("Initialize CC3000 FAIL!"));
		#endif
		return;
	}

	else {
		//FreeRam();
		#ifdef CC3000_DEBUG
			DEBUGPRINTLN(PSTR("Initialize CC3000 OK"));
		#endif
	}

	if(!wifi.connect(ap_ssid, ap_security, ap_password, timeout)) 
	{
		#ifdef CC3000_DEBUG
			DEBUGPRINTLN(PSTR("Error: Could not connect to AP!"));
		#endif
	}
	
	
	// Gather connection details and print IP address
	if(!wifi.getConnectionInfo(connection_info) )
	{
		#ifdef CC3000_DEBUG
		DEBUGPRINTLN(PSTR("Error: Could not obtain connection details"));
		#endif
		return;
	}
	
	else
	{
		#ifdef CC3000_DEBUG
		DEBUGPRINT(PSTR("IP Address: "));
		printIPAddr(connection_info.ip_address);
		#endif
	}

	pin_mode(SERVO_PIN_X, OUTPUT);    // declare the LED's pin as output
	pin_mode(SERVO_PIN_Y, OUTPUT);    // declare the LED's pin as output

	servo_x.attach(SERVO_PIN_X);
	servo_y.attach(SERVO_PIN_Y);

	// center servos
	servo_x.write(SERVO_CENTER_X);
	servo_y.write(SERVO_CENTER_Y);

	_delay_ms(200);
}

void loop()
{
	
}

Credits

vicente zavala

vicente zavala

11 projects • 24 followers
Freelance Programmer, Internet Of Things (IOT), CNC Plasma Cutting Creator, Software Developer.

Comments