Tipkalo pali LED-icu koja ispisuje S.O.S. u Morse-ovom codu
Dependents: MorseCODE-MarkoJuric
MorseWrite.h@0:40962a766bc2, 2021-05-07 (annotated)
- Committer:
- mjuric
- Date:
- Fri May 07 11:49:46 2021 +0000
- Revision:
- 0:40962a766bc2
Morse-code
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mjuric | 0:40962a766bc2 | 1 | #ifndef MBED_MORSEWRITE_H |
mjuric | 0:40962a766bc2 | 2 | #define MBED_MORSEWRITE_H |
mjuric | 0:40962a766bc2 | 3 | |
mjuric | 0:40962a766bc2 | 4 | #include "mbed.h" |
mjuric | 0:40962a766bc2 | 5 | |
mjuric | 0:40962a766bc2 | 6 | class MorseWrite { |
mjuric | 0:40962a766bc2 | 7 | public: |
mjuric | 0:40962a766bc2 | 8 | MorseWrite(PinName pin); |
mjuric | 0:40962a766bc2 | 9 | void write(int message, short n); |
mjuric | 0:40962a766bc2 | 10 | |
mjuric | 0:40962a766bc2 | 11 | private: |
mjuric | 0:40962a766bc2 | 12 | DigitalOut _pin; |
mjuric | 0:40962a766bc2 | 13 | const short dotDuration = 1; |
mjuric | 0:40962a766bc2 | 14 | const short dashDuration = 3; |
mjuric | 0:40962a766bc2 | 15 | const short newLetterDuration = 3; |
mjuric | 0:40962a766bc2 | 16 | const short spaceDuration = 7; |
mjuric | 0:40962a766bc2 | 17 | const float duration = 0.3; |
mjuric | 0:40962a766bc2 | 18 | }; |
mjuric | 0:40962a766bc2 | 19 | |
mjuric | 0:40962a766bc2 | 20 | #endif |