Hello World With Intel Galileo

Introduction

 
Galileo is an Arduino compatible Microcontroller board. Arduino is an open-source platform used for building electronics projects. A microcontroller is an integrated computer on a chip.
 
chip
 
“Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It’s intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.”
 
When you set up the dev environment the first program you run is Blinking the LED, hence it is called the Hello World of Electronics. So before learning complex programs let us see how we can blink an LED with the Intel Galileo board.
 
Requirements:
  • Intel Galileo
  • Power Supply
  • An LED
We will be using the Arduino IDE for coding. Download the IDE from the software page of the Arduino website.
 
Unzip the application. You don’t need to install it, when you open the application it will look like this.
 
application
 
The programs you write in Arduino are called sketches. There are two functions in a sketch.
  1. Loop
  2. Setup
The setup method runs only once and the loop method runs again and again.
 
The basic sketch of program should look like this:
  1. void setup()  
  2. {  
  3.   
  4. }  
  5.   
  6. void loop()  
  7. {  
  8.   
  9. }  
In the Arduino IDE goto the Board Manager and download Intel Galileo board from the various options provided.
 
Manager
 
Now from Tools under Board select your Galileo Gen1 or Gen 2. In my case it is Galileo Gen 2.
 
 Galileo Gen 2
 
Also ensure that your Arduino IDE is pointing to the correct serial port. You can always check this from Device Manager.
 
The Arduino IDE has many examples that we can use, we will run Blink LED example. We will test our Galileo with the Example that you can find under File -> Examples -> Basics -> Blink
 
Blink
 
Code:
  1. // the setup function runs once when you press reset or power the board  
  2. void setup() {  
  3. // initialize digital pin 13 as an output.  
  4. pinMode(13, OUTPUT);  
  5. }  
  6.   
  7. // the loop function runs over and over again forever  
  8. void loop() {  
  9. digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)  
  10. delay(1000); // wait for a second  
  11. digitalWrite(13, LOW); // turn the LED off by making the voltage LOW  
  12. delay(1000); // wait for a second  
  13. }  
code
 
Now hook the LED carefully to pin 13 of the board. Insert cathode in pin 13 and anode in-ground pin. The longer leg is the cathode and shorter is the anode.
 
anode
 
Now deploy the code by clicking on the deploy button. You will notice the LED blinking on your board.
 
Read more articles on Arduino: