From 3b33d88f5621a8d40ccf4c0177c98f63a5c19c38 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Thu, 1 Jan 1970 01:45:37 +0100 Subject: Initial commit --- morse.cpp | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 morse.cpp (limited to 'morse.cpp') diff --git a/morse.cpp b/morse.cpp new file mode 100644 index 0000000..95c5114 --- /dev/null +++ b/morse.cpp @@ -0,0 +1,104 @@ +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; +void dot() +{ + cout << "." << flush; + setLight(true); + usleep(250000); + setLight(false); +} +void dash() +{ + cout << "-" << flush; + setLight(true); + usleep(750000); + setLight(false); +} +static map table; +void transmit(const string& str) +{ + cout << "Transmitting message in Morse code via ACT LED..." << endl; + for(unsigned long long i=0;i