This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define dotPeriod 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define dotPeriod (analogRead(2)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define dashPeriod (dotPeriod*3) | |
#define relaxTime (dotPeriod) | |
#define letterSpace (dotPeriod*2) | |
#define wordSpace (dotPeriod*4) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define buzz 1000 | |
#define tonePin 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define buzz (analogRead(1)+200) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void dit() | |
{ | |
tone(tonePin, buzz); | |
delay(dotPeriod); | |
noTone(tonePin); | |
delay(relaxtime); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void dah() | |
{ | |
tone(tonePin, buzz); | |
delay(dahPeriod); | |
noTone(tonePin); | |
delay(relaxtime); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void di() | |
{ | |
dit(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void playLetter(char x) | |
{ | |
switch (x): | |
case 'E': | |
dit(); return; | |
case 'T': | |
dah(); return; | |
case 'A': | |
di();dah(); return; | |
case 'O': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() | |
{ | |
Serial.begin(9600); | |
/* Using the serial command I program the Arduino to communicate at a baud rate of 9600 bits per second. */ | |
pinMode(tonePin, OUTPUT); | |
// This command sets the pin to act as output | |
} |
OlderNewer