Practice your morse code.
Dependencies: mbed
main.cpp
- Committer:
- john78727
- Date:
- 2013-06-28
- Revision:
- 5:ea8cde7c817f
- Parent:
- 4:6840cc0ea570
File content as of revision 5:ea8cde7c817f:
#include "mbed.h" #include "main.h" #include "Morse_Code.h" #define test DigitalOut blue ( LED_BLUE ); DigitalOut red ( LED_RED ); DigitalOut green ( LED_GREEN ); AnalogOut piezo ( PTE30 ); #ifdef test Morse_Code A = Morse_Code ( 18.0, 15.0, 375, 1 ); Morse_Code B = Morse_Code ( 18.0, 15.0, 375, 2 ); Morse_Code C = Morse_Code ( 18.0, 15.0, 375, 3 ); Morse_Code D = Morse_Code ( 18.0, 15.0, 375, 4 ); #else Morse_Code A = Morse_Code ( 18.0, 10.0, 400, 1 ); Morse_Code B = Morse_Code ( 18.0, 15.0, 350, 2 ); Morse_Code C = Morse_Code ( 18.0, 20.0, 300, 3 ); Morse_Code D = Morse_Code ( 18.0, 30.0, 250, 4 ); #endif int main() { int i; while(1) { #ifdef test A.Random_Code(); B.Random_Code(); C.Random_Code(); D.Random_Code(); #else for ( i = 0; i < 10; i++ ) A.Random_Code(); for ( i = 0; i < 10; i++ ) B.Random_Code(); for ( i = 0; i < 10; i++ ) C.Random_Code(); for ( i = 0; i < 10; i++ ) D.Random_Code(); #endif } } //=============================================================