arduino morse code – Kevin Gulling http://www.kevingulling.com Game Development, VR, and more Sun, 11 Dec 2016 21:33:43 +0000 en-US hourly 1 https://wordpress.org/?v=5.9.13 81085834 Hello World Arduino Uno R3 Morse Code Sketch – 2016 https://kevingulling.com/2016/11/hello-world-arduino-uno-r3-morse-code-sketch/ Fri, 11 Nov 2016 20:09:39 +0000 https://kevingulling.com/?p=1166 Recently I decided to get started prototyping the VR device I invented back in 2014. I chose to use an Arduino Uno R3 for my micro-controller. I was amazed how easy it was to get started right out of the box! Below is a copy of my first Arduino “Sketch” (they are known as sketches […]

The post Hello World Arduino Uno R3 Morse Code Sketch – 2016 appeared first on Kevin Gulling - Game Development, VR, and more.

]]>

vlcsnap-2016-11-11-18h44m40s546

Recently I decided to get started prototyping the VR device I invented back in 2014. I chose to use an Arduino Uno R3 for my micro-controller. I was amazed how easy it was to get started right out of the box!

Below is a copy of my first Arduino “Sketch” (they are known as sketches rather than programs or scripts), it repeats “hello world” in Morse code.

This is a very simple way to accomplish this, not necessarily the best way. I don’t store any values or functions which would probably improve the efficiency a little.





void setup() {
pinMode(13, OUTPUT);

}

void loop() {
//hello world morse code

//H
digitalWrite(13, HIGH); // sets the LED on
delay(200); // waits for a second
digitalWrite(13, LOW); // sets the LED off
delay(100);
digitalWrite(13, HIGH); // sets the LED on
delay(200); // waits for a second
digitalWrite(13, LOW); // sets the LED off
delay(100);
digitalWrite(13, HIGH); // sets the LED on
delay(200); // waits for a second
digitalWrite(13, LOW); // sets the LED off
delay(100);
digitalWrite(13, HIGH); // sets the LED on
delay(200); // waits for a second

//break
digitalWrite(13, LOW); // sets the LED off
delay(400);

//E
digitalWrite(13, HIGH); // sets the LED on
delay(200);

//break
digitalWrite(13, LOW); // sets the LED off
delay(400);

//L
digitalWrite(13, HIGH); // sets the LED on
delay(200);
digitalWrite(13, LOW); // sets the LED off
delay(100);
digitalWrite(13, HIGH); // sets the LED on
delay(400);
digitalWrite(13, LOW); // sets the LED off
delay(100);
digitalWrite(13, HIGH); // sets the LED on
delay(200);
digitalWrite(13, LOW); // sets the LED off
delay(100);
digitalWrite(13, HIGH); // sets the LED on
delay(200);

//break
digitalWrite(13, LOW); // sets the LED off
delay(400);

//L
//dit
digitalWrite(13, HIGH); // sets the LED on
delay(200);
digitalWrite(13, LOW); // sets the LED off
delay(100);
//dah
digitalWrite(13, HIGH); // sets the LED on
delay(400);
digitalWrite(13, LOW); // sets the LED off
delay(100);
//dit
digitalWrite(13, HIGH); // sets the LED on
delay(200);
digitalWrite(13, LOW); // sets the LED off
delay(100);
//dit
digitalWrite(13, HIGH); // sets the LED on
delay(200);

//break
digitalWrite(13, LOW); // sets the LED off
delay(400);

//O
//dah
digitalWrite(13, HIGH); // sets the LED on
delay(400);
digitalWrite(13, LOW); // sets the LED off
delay(100);
//dah
digitalWrite(13, HIGH); // sets the LED on
delay(400);
digitalWrite(13, LOW); // sets the LED off
delay(100);
//dah
digitalWrite(13, HIGH); // sets the LED on
delay(400);

//word break
digitalWrite(13, LOW); // sets the LED off
delay(1600);

//W
//dit
digitalWrite(13, HIGH); // sets the LED on
delay(200);
digitalWrite(13, LOW); // sets the LED off
delay(100);
//dah
digitalWrite(13, HIGH); // sets the LED on
delay(400);
digitalWrite(13, LOW); // sets the LED off
delay(100);
//dah
digitalWrite(13, HIGH); // sets the LED on
delay(400);

//break
digitalWrite(13, LOW); // sets the LED off
delay(400);

//O
//dah
digitalWrite(13, HIGH); // sets the LED on
delay(400);
digitalWrite(13, LOW); // sets the LED off
delay(100);
//dah
digitalWrite(13, HIGH); // sets the LED on
delay(400);
digitalWrite(13, LOW); // sets the LED off
delay(100);
//dah
digitalWrite(13, HIGH); // sets the LED on
delay(400);

//break
digitalWrite(13, LOW); // sets the LED off
delay(400);

//R
//dit
digitalWrite(13, HIGH); // sets the LED on
delay(200);
digitalWrite(13, LOW); // sets the LED off
delay(100);
//dah
digitalWrite(13, HIGH); // sets the LED on
delay(400);
digitalWrite(13, LOW); // sets the LED off
delay(100);
//dit
digitalWrite(13, HIGH); // sets the LED on
delay(200);

//break
digitalWrite(13, LOW); // sets the LED off
delay(400);

//L
//dit
digitalWrite(13, HIGH); // sets the LED on
delay(200);
digitalWrite(13, LOW); // sets the LED off
delay(100);
//dah
digitalWrite(13, HIGH); // sets the LED on
delay(400);
digitalWrite(13, LOW); // sets the LED off
delay(100);
//dit
digitalWrite(13, HIGH); // sets the LED on
delay(200);
digitalWrite(13, LOW); // sets the LED off
delay(100);
//dit
digitalWrite(13, HIGH); // sets the LED on
delay(200);

//break
digitalWrite(13, LOW); // sets the LED off
delay(400);

//D
//dah
digitalWrite(13, HIGH); // sets the LED on
delay(400);
digitalWrite(13, LOW); // sets the LED off
delay(100);
//dit
digitalWrite(13, HIGH); // sets the LED on
delay(200);
digitalWrite(13, LOW); // sets the LED off
delay(100);
//dit
digitalWrite(13, HIGH); // sets the LED on
delay(200);
//final break
digitalWrite(13, LOW); // sets the LED off
delay(3200);

}


morse code cheat sheet

The post Hello World Arduino Uno R3 Morse Code Sketch – 2016 appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
1166