The example program for mbed pin-compatible platforms
Fork of mbed_blinky by
Diff: main.cpp
- Revision:
- 9:9088b8a51286
- Parent:
- 8:ec3e22e9100e
- Child:
- 11:87bc5f44dcfa
--- a/main.cpp Sun Aug 24 02:12:15 2014 +0000 +++ b/main.cpp Sun Aug 24 02:16:32 2014 +0000 @@ -5,11 +5,11 @@ DigitalOut morseOut(LED1); int main() { - char* output = "HELLO WORLD"; - char strlen = 11; + char* output = "Hello World"; + char outputLength = strlen(output); char strpos = 0; float timeUnit = 0.092f; - while(strpos < strlen) { + while(strpos < outputLength) { MorseCharacter morseChar(output[strpos]); char size = morseChar.getNumberOfParts(); if(size>0) { @@ -28,8 +28,10 @@ // character was sent. } strpos++; - //strpos = (strpos + 1) % strlen; - + if(strpos == outputLength) { + wait(5.0f); // wait 5 seconds + strpos = 0; // start over; + } } while(1) {}