Arduino Logo

Arduino Beginner’s Course Lesson 1- Introduction to Arduino





You can download our e-book ‘Learn Arduino from Scratch’ from this link

This tutorial is the first from a series of tutorials for absolute beginners on Arduino. We at Runtime Projects feel that beginners should not struggle to get started with Arduino. In light of this, we are inviting all our visitors to follow this short course, and if we can help in any way, please use our contact form here. We will try our best to answer your questions.

In this course we will go through basic Arduino stuff, simple and easy to follow tutorials with sample code. By the end of the course you will create an interesting project to control stuff attached to Arduino with your phone though WiFi, using Evothings framework 🙂

What is Arduino?

Arduino is an open source hardware and software project, created with a simple aim in mind, to be as simple as possible. Arduino is not some hardware you should be afraid of. It was created for people with no profound knowledge of electronics. Arduino comes in a variety of flavors and sizes. It has it’s own programming language based on C, with bare functionality. The good thing about the Arduino Programming  Language is that libraries can be created and distributed freely. This facilitates many aspects of your project with added functionality and code (normally very complex) ready to be used. The Arduino is programmed by it’s own IDE, a simple yet very reliable IDE.

Arduino Boards

Arduino comes in a variety of different boards. These boards offer distinct features for particular projects. These include but not limited to,

These are just what we think are the mostly used boards. For the rest of the course, we will be using the Arduino Uno which by far is the most popular board. It is the most comfortable to work with, mainly because of its size, its USB connector and power connector.

The IDE

I assume you have already installed the IDE, if not, install it now. The IDE can be downloaded from Arduino website here. Follow the installation manual if you like. I’ll wait ……..

OK. All installed and ready. Grab your Arduino connect it to the PC via the cable, Windows will start installing the necessary drivers. That done, you can fire the IDE.

Arduino IDE
Arduino IDE

As you can see at the bottom right corner, ‘Arduino/Genuino Uno on COM9’. These are the board and port being used. Both need to match your own, and could be different then mine. In order to change the board got to Tools > Board > Select your board. The COM port can be changed from Tools > Port > Select the COM port which the Arduino is connected to.




A quick explanation of the basic IDE functionalities. Starting from the top left corner,

  • the ‘very good’ sign compiles the code.
  • the ‘arrow’ sign compiles and uploads the compiled code to the Arduino board
  • next are New, Open and Save

Now you are ready to program your first Arduino project, btw an Arduino program is often called ‘a sketch’. You may be wondering why the setup() and the loop() functions. These are the main functions that all sketches/programs need to contain. Much like the main() function in C, java or C#.

The setup() is called only once, when the board is started/restarted.

The loop() is repeatedly called whilst the Arduino is running.

Lets write our very first code. You don’t need to understand everything (all will be explained later on).


//this is the pin we will control
//normally this pin has an onboard LED attached to it
int ledPin = 13;

void setup() {
// put your setup code here, to run once:

//making the pin act as Output, because we will write a value to it
pinMode(13,OUTPUT);
}

void loop() {
// put your main code here, to run repeatedly:

//writing the value HIGH to the ledPin. Switches the LED on
digitalWrite(ledPin,HIGH);
//this will pause the execution for 1 second
delay(1000);

//writing the value LOW to the ledPin. Switches the LED off
digitalWrite(ledPin,LOW);
//this will pause the execution for 1 second
delay(1000);
}

Copy this code and hit the compile and upload button, the arrow button.

This should switch ON the LED for 1 second then back OFF for 1 second and it keeps on going forever hmm … till you pull the plug 🙂

Stay tuned for the next lesson

Go to Lesson 2 here

Tags:

  1. “//writing the value HIGH to the ledPin. Switches the LED off”

    HIGH should read LOW

  2. hello !
    I don’t understand why, in courses for beginners, a program is allways supposed to be built with only two parts :
    void setup()
    void loop ()
    But most of the time there is a third part before “void setup()” !
    Nothing is said about this one.
    What types of instructions shall we place there ???
    Same questions for viod setup () ? What shall we place there ?
    Thank for help !

Leave a Reply

Your email address will not be published. Required fields are marked *