Morsecode programma opdracht 1.1
Dependencies: mbed
Diff: MorseCode.cpp
- Revision:
- 0:5a59e3e00ed6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MorseCode.cpp Sat Mar 10 09:38:02 2018 +0000 @@ -0,0 +1,45 @@ +/* +Namen: Lennart Groen +Klas: EMT1PSa +Opdracht: MBED - Morse code blinker +Samengewerkt met: ... +Datum: 10-03-2018 +Inspiratie uit: +*/ + +#include "mbed.h" + +DigitalOut myled(LED1); + +void s() +{ + for(int i = 0; i<3; i++){ + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + } +} + +void o() +{ + for(int i = 0; i<2; i++){ + myled = 1; + wait(0.5); + myled = 0; + wait(0.5); + } +} + +int main() +{ + while(1){ + s(); + o(); + s(); + wait(1); + } +} + + +