![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
led
main.cpp@0:07dda97b5a79, 2015-11-16 (annotated)
- Committer:
- david_burg
- Date:
- Mon Nov 16 14:38:39 2015 +0000
- Revision:
- 0:07dda97b5a79
first led test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
david_burg | 0:07dda97b5a79 | 1 | #include "mbed.h" |
david_burg | 0:07dda97b5a79 | 2 | #include "const.h" |
david_burg | 0:07dda97b5a79 | 3 | #include "Robot.h" |
david_burg | 0:07dda97b5a79 | 4 | |
david_burg | 0:07dda97b5a79 | 5 | Robot bertl; |
david_burg | 0:07dda97b5a79 | 6 | |
david_burg | 0:07dda97b5a79 | 7 | int main() |
david_burg | 0:07dda97b5a79 | 8 | { |
david_burg | 0:07dda97b5a79 | 9 | |
david_burg | 0:07dda97b5a79 | 10 | |
david_burg | 0:07dda97b5a79 | 11 | while(1) |
david_burg | 0:07dda97b5a79 | 12 | { |
david_burg | 0:07dda97b5a79 | 13 | bertl.TurnLedOn(LED_FL1); |
david_burg | 0:07dda97b5a79 | 14 | bertl.TurnLedOn(LED_FL2); |
david_burg | 0:07dda97b5a79 | 15 | wait_ms(500); |
david_burg | 0:07dda97b5a79 | 16 | bertl.TurnLedOff(LED_FL1); |
david_burg | 0:07dda97b5a79 | 17 | bertl.TurnLedOff(LED_FL2); |
david_burg | 0:07dda97b5a79 | 18 | |
david_burg | 0:07dda97b5a79 | 19 | bert.NibbleLeds(0x0F); |
david_burg | 0:07dda97b5a79 | 20 | |
david_burg | 0:07dda97b5a79 | 21 | |
david_burg | 0:07dda97b5a79 | 22 | bertl.TurnLedOn(LED_FR1); |
david_burg | 0:07dda97b5a79 | 23 | bertl.TurnLedOn(LED_FR2); |
david_burg | 0:07dda97b5a79 | 24 | wait_ms(500); |
david_burg | 0:07dda97b5a79 | 25 | bertl.TurnLedOff(LED_FR1); |
david_burg | 0:07dda97b5a79 | 26 | bertl.TurnLedOff(LED_FR2); |
david_burg | 0:07dda97b5a79 | 27 | |
david_burg | 0:07dda97b5a79 | 28 | bertl.RGBLed(1,0,0); |
david_burg | 0:07dda97b5a79 | 29 | wait_ms(500); |
david_burg | 0:07dda97b5a79 | 30 | bertl.RGBLed(0,1,0); |
david_burg | 0:07dda97b5a79 | 31 | wait_ms(500); |
david_burg | 0:07dda97b5a79 | 32 | bertl.RGBLed(0,0,1); |
david_burg | 0:07dda97b5a79 | 33 | wait_ms(500); |
david_burg | 0:07dda97b5a79 | 34 | bertl.RGBLed(0,0,0); |
david_burg | 0:07dda97b5a79 | 35 | |
david_burg | 0:07dda97b5a79 | 36 | bertl.TurnLedOn(LED_BR1); |
david_burg | 0:07dda97b5a79 | 37 | bertl.TurnLedOn(LED_BR2); |
david_burg | 0:07dda97b5a79 | 38 | wait_ms(500); |
david_burg | 0:07dda97b5a79 | 39 | bertl.TurnLedOff(LED_BR1); |
david_burg | 0:07dda97b5a79 | 40 | bertl.TurnLedOff(LED_BR2); |
david_burg | 0:07dda97b5a79 | 41 | |
david_burg | 0:07dda97b5a79 | 42 | bertl.TurnLedOn(LED_BL1); |
david_burg | 0:07dda97b5a79 | 43 | bertl.TurnLedOn(LED_BL2); |
david_burg | 0:07dda97b5a79 | 44 | wait_ms(500); |
david_burg | 0:07dda97b5a79 | 45 | bertl.TurnLedOff(LED_BL1); |
david_burg | 0:07dda97b5a79 | 46 | bertl.TurnLedOff(LED_BL2); |
david_burg | 0:07dda97b5a79 | 47 | |
david_burg | 0:07dda97b5a79 | 48 | } |
david_burg | 0:07dda97b5a79 | 49 | } |