Sunday 15 July 2012

Arduino tutorial

we intend to dump small codes onto arduino in linux,

We will use roboduino which is similar to arduino

Start by Downloading the IDE for Arduino boards, namely Arduino 1.0.1 from
http://arduino.cc/en/Main/Software

Open the IDE

Connect the Arduino Board using the USB cable provided with the
board


Go to Tools Serial Port to make sure that the Board has been recog-
nised. Select the appropriate port from the list. Also select the right
board from Tools Board. Roboduino uses Arduino Duemilanove. The
board given to us was Arduino Duemilanove with ATMega328 proces-
sor (If you are using any other board with different processor then all you have to do is choose the appropriate one from the list).

Go to File Examples 1.Basics Blink . This will open the blink pro-
gram from the list of sample programs provided with the IDE

Compile the program either by going to Sketch Verify/Compile or by
pressing Ctrl+R . Correct any errors that may appear. Since this is a
preloaded example program, it should compile without errors.

Go to File Upload to upload the program to the board or press
Ctrl+U.


Arduino led blink code

int led = 13;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH);
// turn the LED on (HIGH is the voltage level)
delay(1000);
// wait for a second
digitalWrite(led, LOW);
// turn the LED off by making the voltage LOW
delay(1000);
// wait for a second
}

Code transfered to arduino board.

No comments:

Post a Comment