Things used in this project

Schematics

basic schematic
Obt schem ux1ji8eg6j

Code

ATmega32u4_ServoObjectTrackingC/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

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Voice-Controlled Locking Device
Advanced
  • 686
  • 7

Full instructions

A voice-controlled project using the EasyVR Shield with an Arduino Uno and gen4-uLCD-43DT.

J.A.R.V.I.S. : A Virtual Home Assistant
Advanced
  • 4,978
  • 80

Full instructions

J.A.R.V.I.S. is a personal home automation assistant for controlling electrical home appliances integrated with an augmented reality app.

Inexpensive Wireless Interactive Board
Advanced
  • 9,299
  • 14

Full instructions

This is a low cost, modular smart board with wireless capabilities.

PrankChair THE BEST ARRIL FOOLS PRANK!
Advanced
  • 250
  • 3

Full instructions

PrankChair is a chair which looks normal but is too abnormal! ;)

Smart Furniture Using Linkit Mediatek 7688 Duo
Advanced
  • 360
  • 8

Protip

We are making smart furniture and our first prototype is for smart computer table.

DIY Code Red Button for Healthcare Simulation
Advanced
  • 834
  • 2

Full instructions

Create your own Code Red button for use in simulation scenarios. Flashing LEDs and Button!

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback