![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
test
main.cpp@0:d794e1fe8c03, 2015-05-18 (annotated)
- Committer:
- vijaydew
- Date:
- Mon May 18 01:19:44 2015 +0000
- Revision:
- 0:d794e1fe8c03
test blink;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vijaydew | 0:d794e1fe8c03 | 1 | #include "mbed.h" |
vijaydew | 0:d794e1fe8c03 | 2 | |
vijaydew | 0:d794e1fe8c03 | 3 | DigitalOut myled(LED1); |
vijaydew | 0:d794e1fe8c03 | 4 | LowPowerTicker toggleTicker; |
vijaydew | 0:d794e1fe8c03 | 5 | |
vijaydew | 0:d794e1fe8c03 | 6 | void ledToggler(void) { |
vijaydew | 0:d794e1fe8c03 | 7 | myled = !myled; |
vijaydew | 0:d794e1fe8c03 | 8 | } |
vijaydew | 0:d794e1fe8c03 | 9 | |
vijaydew | 0:d794e1fe8c03 | 10 | int main() { |
vijaydew | 0:d794e1fe8c03 | 11 | toggleTicker.attach(&ledToggler, 0.2f); |
vijaydew | 0:d794e1fe8c03 | 12 | while(1) { |
vijaydew | 0:d794e1fe8c03 | 13 | sleep(); |
vijaydew | 0:d794e1fe8c03 | 14 | } |
vijaydew | 0:d794e1fe8c03 | 15 | } |