Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Servo mbed-rtos mbed
led.cpp@2:7dfc8dd6aab3, 2015-10-08 (annotated)
- Committer:
- mariob
- Date:
- Thu Oct 08 13:36:17 2015 +0000
- Revision:
- 2:7dfc8dd6aab3
- Parent:
- 1:79b1ee0f97ef
added body implementation
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 | 2:7dfc8dd6aab3 | 6 | static DigitalOut alive_led(HW_ALIVE_LED); |
| mariob | 0:ce6055872f4e | 7 | |
| mariob | 0:ce6055872f4e | 8 | void blink_led() |
| mariob | 0:ce6055872f4e | 9 | { |
| mariob | 2:7dfc8dd6aab3 | 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 | 2:7dfc8dd6aab3 | 15 | //alive blinking led - 1Hz |
| mariob | 2:7dfc8dd6aab3 | 16 | alive_led = 0; |
| mariob | 2:7dfc8dd6aab3 | 17 | alive_ticker.attach(blink_led, 1.0); |
| mariob | 0:ce6055872f4e | 18 | } |