This is the code we showed at Uncraftivism

Dependencies:   mbed

Revision:
1:70d90598d2e7
Parent:
0:57f4fdadc97f
Child:
2:01115080f6da
--- a/ucam.cpp	Fri Nov 20 14:40:48 2009 +0000
+++ b/ucam.cpp	Thu Dec 10 21:16:57 2009 +0000
@@ -31,19 +31,42 @@
 
 Servo xServo (p21);
 Servo yServo (p22);
+Servo eyelidServo (p23); 
+#define EYE_CLOSED 0.15
+#define EYE_OPEN 0.8 
 
 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() {
    
+    
+      
     ucam.doStartup();
     Frame::initFrames();
+    
+     
+    testEyelid();
+  
     motionFinder = new MotionFinder( new ServoMinder(&xServo), new ServoMinder(&yServo) );
     
 }
 
+
 void UCamGetJpeg()
 {
     ucam.doConfig( false, UCAM_COLOUR_JPEG, UCAM_JPEG_SIZE_640x480 ); 
@@ -58,6 +81,7 @@
 }
 
 Frame* UCamGetRaw( )
+
 {
     ucam.doConfig( true, UCAM_COLOUR_4_BIT_GREY, UCAM_RAW_SIZE_80x60);