This first lesson will teach you how to use the hardware and software together to make the led light up.
Now that we are familiar with the Arduino and have installed the program on our computer we can now move on to the first lesson.
Once you get comfortable operating the sketchbook we move on to the more exciting stuff.
STEP 1: Gather your equipment.
For this first lesson you will only need a few things to get the project up and running. You will need:
* Arduino
* Laptop or PC
* USB connector cable
* LED is optional most Arduinos will have a built in LED to test with. You can change sketch to use a different pin and use an led of your choice.
STEP 2: Open the Software
***OPEN ARDUINO PROGRAM***
First things first click on the Arduino icon that you have installed onto your desktop. Once opened you will be brought to the Arduino sketchbook. This is where the magic happens. The sketchbook is used to input the code that will be uploaded to the Arduino, it is fairly simple to use once who get familiar navigating around. When you open it up you will be met with a window such as the picture shown.
***Next***
Go to the File menu -> Sketchbook -> Examples -> Basics -> Blink
Once you select the "BLINK" sketch a window will pop up which will look like this picture. This is the code we will be using for our very first lesson. Thankfully someone came along and did the hard stuff for us. The beauty of using these prewritten codes is that we can learn alot by examples. For example you can fiddle around and change output pins for the led. Another advantage of learning by examples is that if you notice on the sketches they have explanations of the codes alongside.
( // wait for a second )
So after you have this sketch in front of you the next step is to load it onto the Arduino.
STEP 3: Connection Time
*** Connecting Arduino to Sketchbook ***
Start off by connecting one end to the Arduino and the free end connected to either your laptop
or you pc.
We are on our way to completing our first program. Hang in there. Once connected to your source ( laptop or pc) you will need to do acouple more things before we move on.
In order to transfer the "Blink" sketch onto the Arduino we firstly need to make sure that the code was been written properly and will work. One of the best things is how the programs has a built in checker that will verify that it makes sense and will run. If the coding isnt correct the sketch will be unable to load. If this happens you will recieve an error message detailing where you went wrong. We will cover common errors in a different post.
As you can see from the picture you have some options when it comes to finishing up on this project. First click on the "Compile" button. This runs a scan of your code and will make sure it is correct.
Next it will ask you to save. Save sure.
Lastly I would like you to click "Upload"
BAMMMM!
STEP 4: COMPLETE
Led "on" |
EXTRAS:
If you are not done playing around you could also try playing around with the code. Maybe change the outputs? Add more leds? The photo on the left shows an led connected directly to the arduino.
Connect the led to Arduino by placing "cathode" of the led ( - ) to the ground pin on Arduino. Place "anode"(+) to pin 13 on the Arduino.
No comments:
Post a Comment