![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
This is the code we showed at Uncraftivism
Diff: ucam.cpp
- Revision:
- 2:01115080f6da
- Parent:
- 1:70d90598d2e7
diff -r 70d90598d2e7 -r 01115080f6da ucam.cpp --- a/ucam.cpp Thu Dec 10 21:16:57 2009 +0000 +++ b/ucam.cpp Mon Dec 14 08:28:21 2009 +0000 @@ -7,6 +7,7 @@ #include "MotionFinder.h" #include "Servo.h" #include "SerialBuffered.h" +#include "Blinker.h" // ucam protocol implementation for mbed @@ -29,38 +30,27 @@ -Servo xServo (p21); +Servo xServo (p23); Servo yServo (p22); -Servo eyelidServo (p23); -#define EYE_CLOSED 0.15 -#define EYE_OPEN 0.8 +Servo eyelidServo (p21); +ServoMinder *eyelidMinder = new ServoMinder( &eyelidServo ); +Blinker *blinker = new Blinker( eyelidMinder ); + MotionFinder *motionFinder = NULL; -void testEyelid() -{ - ServoMinder *eyelidMinder = new ServoMinder( &eyelidServo ); - - eyelidMinder->setSpeed( 1 ); - eyelidMinder->moveToAndWait( EYE_CLOSED ); - - eyelidMinder->setSpeed( 0.1 ); - eyelidMinder->moveToAndWait( EYE_OPEN ); - eyelidMinder->setSpeed( 2 ); - eyelidMinder->moveToAndWait( EYE_CLOSED ); - eyelidMinder->moveToAndWait( EYE_OPEN ); -} void UCamInit() { - + + + blinker->close(); ucam.doStartup(); Frame::initFrames(); - - testEyelid(); + blinker->open(); motionFinder = new MotionFinder( new ServoMinder(&xServo), new ServoMinder(&yServo) );