Things used in this project

Hardware components:
A000066 iso both
Arduino UNO & Genuino UNO
×1
09590 01
LED (generic)
×1
11026 02
Jumper wires (generic)
×1
Mfr 25fbf52 221r sml
Resistor 221 ohm
×1
Software apps and online services:
Ide web
Arduino IDE
Vs2015logo
Microsoft Visual Studio 2015
Hand tools and fabrication machines:
Hy gluegun
Hot glue gun (generic)

Custom parts and enclosures

WINDOWSFORM APPLICATION
MORSE.EXE
morse_RCSRE0ggDp.exe

Schematics

Circuit
Morse ebkqojurmc

Code

Arduino CodeC/C++
int mrs = 7; 
int slsh = 4; 
int spc = 10; 
int ddot=100;
int ddash=500;
void setup() { 
  Serial.begin(9600);
pinMode(mrs, OUTPUT); 
pinMode(slsh, OUTPUT); 
pinMode(spc, OUTPUT); 
}

void loop() { 

}
//////////////////
String Splitter(String data, char separator, int index)
{
    int found = 0;
    int strIndex[] = { 0, -1 };
    int maxIndex = data.length() - 1;
    

    for (int i = 0; i <= maxIndex && found <= index; i++) {
        if (data.charAt(i) == separator || i == maxIndex) {
            found++;
            strIndex[0] = strIndex[1] + 1;
            strIndex[1] = (i == maxIndex) ? i+1 : i;
        }
    }
    return found > index ? data.substring(strIndex[0], strIndex[1]) : "";
}
///////////////////////////
void serialEvent (){
  String serialResponse = Serial.readString();
  int _length = serialResponse.length();
  String morse[_length];
  for(int i = 0 ; i <= _length ; i++)
  {
     morse[i] = Splitter(serialResponse, '`', i);
  }
  for (int j = 0 ; j <=_length ; j++)
  {
    if(morse[j]==".")dot();
    else if(morse[j]=="-")dash();
    else if(morse[j]=="/")slash();
    else if(morse[j]=="s")space();
  }Serial.println("End");
  
}
void space ()
{
 // Serial.println("space ");
  digitalWrite(spc, HIGH); 
delay(500); 
digitalWrite(spc, LOW); delay(400);
}
void slash ()
{
//  Serial.println("slash ");
  digitalWrite(slsh, HIGH); 
delay(1600); 
digitalWrite(slsh, LOW); delay(400);
}
void dot ()
{
//  Serial.println("dot ");
  digitalWrite(mrs, HIGH); 
delay(ddot); 
digitalWrite(mrs, LOW); delay(400);
}
void dash ()
{
//  Serial.println("dash ");
  digitalWrite(mrs, HIGH); 
delay(ddash); 
digitalWrite(mrs, LOW); delay(400);
}

Credits

Profile eooucbil68
Alireza Karkon
4 projects • 10 followers
Hey guys! I'm Alireza. I'm a student (Bachelor of Technology)-Computer EngrgTech. I'm C# / C++ / Unity programmer and familiar to Front-End.
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Add projectSign up / Login