Tutorial 2 - SOS: This is an embedded program which controls LED1 in order to show a blinking SOS pattern. The tutorial starts to organize helper functions like "morse" in a brick library which will grow and grow with each tutorial. Platform specifics are identified in "bricks/platform.h" by setting proper defines (like LED_INVERTED), which are used to achieve platform independent behaviour. The program has been tested on Nordic nRF51-DK and STM NUCLEO-F303K8, NUCLEO-F401RE and NUCLEO-L476RG.
main.cpp@1:10299215b49e, 2016-12-10 (annotated)
- Committer:
- hux
- Date:
- Sat Dec 10 18:34:23 2016 +0000
- Revision:
- 1:10299215b49e
- Parent:
- 0:9bbb539e0614
Some fine tuning; readme file added
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hux | 0:9bbb539e0614 | 1 | // SOS - let LED1 blink according to a SOS pattern |
hux | 0:9bbb539e0614 | 2 | // Tested with nRF51-DK, NUCLEO-F401RE, NUCLEO-L476RG, NUCLEO-F303K8 |
hux | 0:9bbb539e0614 | 3 | |
hux | 1:10299215b49e | 4 | #include "bricks/blink.h" |
hux | 0:9bbb539e0614 | 5 | |
hux | 1:10299215b49e | 6 | main() |
hux | 1:10299215b49e | 7 | { |
hux | 1:10299215b49e | 8 | for(;;) |
hux | 1:10299215b49e | 9 | { |
hux | 1:10299215b49e | 10 | morse("x x x xxx xxx xxx x x x "); // morse 'SOS' |
hux | 1:10299215b49e | 11 | } |
hux | 1:10299215b49e | 12 | } |