car chassis
Dependencies: Servo mbed-rtos mbed
led.cpp@1:79b1ee0f97ef, 2015-08-31 (annotated)
- Committer:
- mariob
- Date:
- Mon Aug 31 22:25:57 2015 +0000
- Revision:
- 1:79b1ee0f97ef
- Parent:
- 0:ce6055872f4e
- Child:
- 2:7dfc8dd6aab3
first commit with the following features: CAN driver (it works), eeprom (it works but it is not used)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mariob | 0:ce6055872f4e | 1 | #include "mbed.h" |
mariob | 1:79b1ee0f97ef | 2 | #include "led.hpp" |
mariob | 1:79b1ee0f97ef | 3 | #include "car_config.hpp" |
mariob | 0:ce6055872f4e | 4 | |
mariob | 1:79b1ee0f97ef | 5 | static Ticker alive_ticker; |
mariob | 1:79b1ee0f97ef | 6 | static DigitalOut alive_led(ALIVE_LED); |
mariob | 0:ce6055872f4e | 7 | |
mariob | 0:ce6055872f4e | 8 | void blink_led() |
mariob | 0:ce6055872f4e | 9 | { |
mariob | 0:ce6055872f4e | 10 | alive_led = !alive_led; |
mariob | 0:ce6055872f4e | 11 | } |
mariob | 0:ce6055872f4e | 12 | |
mariob | 0:ce6055872f4e | 13 | void init_led () |
mariob | 0:ce6055872f4e | 14 | { |
mariob | 0:ce6055872f4e | 15 | //alive blinking led - 1Hz |
mariob | 0:ce6055872f4e | 16 | alive_led = 0; |
mariob | 0:ce6055872f4e | 17 | alive_ticker.attach(blink_led, 1.0); |
mariob | 0:ce6055872f4e | 18 | } |