int FastOn = 150;
int FastOff = 150;
int SlowOn = 500;
int SlowOff = 300;
int NewLetter = 0700;
int NewWord = 3000;
int buttonState = 0;
char data = 'X';
const int buttonPin = 2;
/*
int FastOn = 10;
int FastOff = 10;
int SlowOn = 20;
int SlowOff = 10;
int NewLetter = 30;
int NewWord = 50;
int buttonState = 0;
char data = 'X';
const int buttonPin = 2;
*/
void setup() {
pinMode(7, OUTPUT);
pinMode(buttonPin, INPUT);
Serial.begin(9600);
}
void loop() {
buttonState = digitalRead(buttonPin);
data = Serial.read();
if(data=='s')
{
Serial.println(data );
delay(1000);
}
if(buttonState == HIGH or data=='s')
{
Serial.print("S " );
for(int x = 0;x < 3;x++)
{
digitalWrite(7, HIGH);
delay(FastOn);
digitalWrite(7, LOW);
delay(FastOff);
}
delay(NewLetter);
Serial.print("O " );
for(int x = 0;x < 3;x++)
{
digitalWrite(7, HIGH);
delay(SlowOn);
digitalWrite(7, LOW);
delay(SlowOff);
}
delay(NewLetter);
Serial.print("S " );
for(int x = 0;x < 3;x++)
{
digitalWrite(7, HIGH);
delay(FastOn);
digitalWrite(7, LOW);
delay(FastOff);
}
Serial.println("" );
delay(NewWord);
}
}