Practical Robotics Modular Robot Library

Dependents:   ModularRobot

Revision:
5:6da8daaeb9f7
Parent:
4:c2e933d53bea
--- a/led.cpp	Mon Jan 02 15:17:22 2017 +0000
+++ b/led.cpp	Mon Jan 02 22:56:34 2017 +0000
@@ -529,5 +529,20 @@
             animation_state ++;
             if(animation_state == 16)animation_state = 0;
             break;
+        case 12:
+            // Alternate red:green
+            if(animation_state ==  0) _set_leds( 64,  0, 64,  0, 64,  0, 64,  0,  0, 64,  0, 64,  0, 64,  0, 64);
+            if(animation_state ==  1) _set_leds(128,  0,128,  0,128,  0,128,  0,  0,128,  0,128,  0,128,  0,128);
+            if(animation_state ==  2) _set_leds(255,  0,255,  0,255,  0,255,  0,  0,255,  0,255,  0,255,  0,255);
+            if(animation_state ==  6) _set_leds(128,  0,128,  0,128,  0,128,  0,  0,128,  0,128,  0,128,  0,128);
+            if(animation_state ==  7) _set_leds( 64,  0, 64,  0, 64,  0, 64,  0,  0, 64,  0, 64,  0, 64,  0, 64);
+            if(animation_state ==  8) _set_leds(  0, 64,  0, 64,  0, 64,  0, 64, 64,  0, 64,  0, 64,  0, 64,  0);
+            if(animation_state ==  9) _set_leds(  0,128,  0,128,  0,128,  0,128,128,  0,128,  0,128,  0,128,  0);
+            if(animation_state ==  10) _set_leds(  0,255,  0,255,  0,255,  0,255,255,  0,255,  0,255,  0,255,  0);
+            if(animation_state ==  14) _set_leds(  0,128,  0,128,  0,128,  0,128,128,  0,128,  0,128,  0,128,  0);
+            if(animation_state ==  15) _set_leds(  0, 64,  0, 64,  0, 64,  0, 64, 64,  0, 64,  0, 64,  0, 64,  0);
+            animation_state ++;
+            if(animation_state == 16)animation_state = 0;
+            break;
     }
 }
\ No newline at end of file