18.06.2013

Arduino Project 1 "Hello Arduino"

Hi everybody,

This is a project to say hello for Arduino :) It is a pretty common practice for beginners who is practicing for a new language but when we say hello we are going to use a little bit different way in this Arduino project :) This project's goal is blinking an LED every 2 seconds so Hello Arduino :)

What do we need to do this project
1 LED
1 Breadboard 
1 330 Ohm Resistor
1  Arduino Mega 2560 or other Arduino boards
Arduino Software

If you want to loot at my all Arduino projects you can visit
http://technologylaboratory.blogspot.com/search/label/Arduino. They are not in English yet. I'm translating them too as this page so you should check them if you want to read my articles about Arduino. I recommend you my blog's Facebook page and Twitter account to follow news easly or you can add me your circle on Google plus.
Technology Laboratory on Twitter 
Technology Laboratory on Facebook


If all components are ready we can start.

The circuit is pretty easy to built it. You can see the schematic view of the project one below. You need to attach a resistor's one leg (its way is not important you can pick any leg) to pin 13 (actually pin number is not important neither you can choose any digital output pin) and then you need to figure out led's positive leg to attach it to breadboard. The LED's positive leg and resistors leg have to be to same row on the breadboard after you attach the LED's negative leg to ground now it's ready to blink the LED. 



 In the second step I'm going to tell you the program that we are going to run it on Arduino.

Code:

/*
**************
H.MelihErdogan
**************
Project 1 
Name : "Hello World"
*/


int ledPin = 13;  // This int variable to keep a pin number that we attached an LED.

void setup(){   // this function works only once. Arduino first run this function. In addition when you reset 
                    // the Arduino it runs again.  

pinMode(ledPin, OUTPUT); // we set the ledPin whose pin number is 13 as an output. It means we 
                                        // can  use this pin to sent digital signal
}
void loop(){    // and the loop. it runs over and over until you turn off the Arduino :) 
digitalWrite(ledPin, HIGH);                // set the led pin as high so turn it on
delay(2000); // (1000msec.=1sec.)    // wait for 2 seconds.
digitalWrite(ledPin, LOW);                // set the led pin as low so turn it off
// high and low mean the voltage level so when we control the voltage level it means we can control // led's status as on or off
}

After you are done with all staff it is time to say hello so you need to connect the Arduino board to your computer via USB port. after wait a few seconds you need to click the verify and upload button. You can see the screenshot from the Arduino software version 0022. It is the old one. There is a new version but the compiling process is almost similar. Note: some libraries and examples are not suitable for Arduino's new version so I recommend both of the newest version one and version 0022 should be installed on your computer.

You can see some picture from the project. I'm going to share the video about this project after I upload it.




have a good one and see you at the next project :)

Did you see something wrong about my English ? Please let me know it and read this page. 




Hiç yorum yok:

Yorum Gönder