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