Arduino Tutorials 001 The LED Circuit

coolyou1Arduino, Computer Hardware, DIY, Future Computing Technology, Robotics, Sci-Fi, Technology, Tutorial

In this lesson we are going to have an on board LED turn on and off over a period of 1 second. I will include pictures, detailed instructions, a list of parts and code you can copy from. Also I am going to assume you are running a current version of windows OS. I will make MAC and Linux edition later.

Parts: Today we are going to need the following

1. Arduino UNO

20130921_221528

2. USBA to USBB cable

20130921_221608

Step One downloading the Drivers and IDE: To download the IDE and drivers first you must go to the Arduino website here. Once you download the ZIP file the file location should be your desktop. Double click on the .EXE file which should have a Arduino logo on it. Click on File then Save as and name the file as First_Basic the extension should be written in automatically.

Step Two Configuring the board: Go to Tools then Board and click on Arduino UNO.

Step Three Writing the code: The following text is the code and comments explaining what is going on.

 

int ledPin = 13; // Declaring your varible
void setup() // Intitilizing ledPin as an output
{
pinMode(ledPin, OUTPUT); // Setting ledpin as an output
}
void loop() // the while loop function
{
digitalWrite(ledPin, HIGH); //HIGH means on
delay(1000); // Waits 1000 milliseconds
digitalWrite(ledPin, LOW); // LOW means off
delay(1000); // Waits 1000 milliseconds
}

 

Have fun re-organizing the code and experimenting. A single controlled light is all you need to use Morse code.

For a challenge, try and find a way to input regular text and see if you can’t make the Arduino convert that into Morse code for you.

*Hint* Try inputting the rules for each letter in advance and then create an input that allows you to insert a letter and have the software link each letter to an LED sequence.