Programming Embedded System in C and C++

Ravindra Rana
3 min readMay 14, 2020

--

Embedded System refers to the Hardware Components integrated to perform some specific operations. They are like computer systems but not computer systems.

They use for specific tasks as we know there are smart parking, Traffic Control System, and different types of automation done by using the Embedded System.

Embedded System themself are not complete, they are just assembled of Hardware Components and integrated with Sensors.

Programming gives life to them. Because of programs, they could function otherwise they are just a box of metal.

So there is a number of programming languages that interact with Embedded System. C and C++ are the core and foundation of Embedded System World.

With the rapid development of technology, there are a number of Embedded Systems and Single Board Computer was developed, some of them are described below.

1. Arduino

Arduino Technology has huge popularities nowadays, there are different types of Board were developed among them Arduino Uno is one of the most popular.

Image Source: https://www.researchgate.net/figure/Figure-1-Arduino-Uno-pin-structure_fig1_303017508

2. Raspberry Pi

Raspberry Pi is also the most popular Embedded System in the World. Most of the students use it for learning computer programming. It is completed tiny Linux machine. It has a different version with different specifications. Nowadays it is used by Maker, Developer, Hacker, and Technology Enthusiast.

Image Source: https://www.researchgate.net/figure/Illustration-of-Raspberry-Pi-3-Model-3-B-along-with-various-subcomponents_fig1_335517346

3. Intel Galileo

Intel Galileo is developed by Intel and compatible with a shield for the Arduino Uno R3. It is based on Intel Quark SoC X1000 Application processor. There are two versions of it Gen 1 and Gen 2.

Image Source: https://www.cooking-hacks.com/media/cooking/images/documentation/tutorial_intel_galileo/galileo_top_small.png

4. BeagleBone Black

BeagleBone Black is a development board at a low cost for developers and hobbyists. It comes with software compatibility of Debian, Android, Ubuntu, etc.

Image Source: https://www.kilobaser.com/blog/2014-07-15-beaglebone-black-gpios

Let’s do some code with Arduino Uno using C and C++

Step 1: Setup

This is the first step so first, you have to install Arduino IDE from the official site. Follow the given link https://www.arduino.cc/en/Main/Software for more watch the video

Step 2: Code

In the above code, there is two functions void setup() and void loop(), it’s ruled an Arduino Program to mention these function like C Programming main() function.

int ledPin = 2; statement defines the GPIO Pin of Arduino Uno D2(digital Pin 2) as ledPin.

In function void setup() there is the use of pinMode(ledPin, OUTPUT); which defines the ledPin as OUTPUT pin that means it gives the output.

Last thing, in function void loop(), there is use of digitalWrite(ledPin, HIGH); gives 1 or TRUE value to ledPin, delay(1000) defines time delay of 1 seconds and digitalWrite(ledPin, LOW); gives 0 or FALSE value to ledPin.

Step 3: Wiring

Required Components

  • Arduino Uno
  • LEDs
  • Breadboard
  • Jumper Wire

--

--

Ravindra Rana
Ravindra Rana

Written by Ravindra Rana

Web Developer | IoT Enthusiast

No responses yet