Hello world in Arduino

This is the most basic programming that you could do with an arduino uno.
It just endlessly turns the light built in the arduino on and off.

So, after having an arduino uno and a usb cable to connect it to your pc, you would want to have also the arduino software.

  • Get the software here: http://arduino.cc/en/Main/Software
  • Extract it into a folder
  • Plug in your arduino in pc
  • Run the program
  • Copy paste the code below on the arduino software
  • Save it and upload it into your arduino… and after the arduino resets you will have your light blinking…

Code:

/*
Hello World program in arduino
*/int Pin = 13;

void setup()
{
//initialize pins as outputs
// Here we are seting pin 13’s mode to output
pinMode(Pin, OUTPUT);
}

// The loop where this code will be executed endlessly
void loop()
{
digitalWrite(Pin, HIGH); // Turn on
delay(1000); // delay 1000mili seconds (1sec)
digitalWrite(Pin, LOW); // Turn off
delay(1000); //delay again
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s