You’ve always wanted to start your adventure as maker but you don’t how to start. It’s hard to know where to begin. I’ve been in your shoes pal! But we have to start somewhere….So, I decided to start my video tutorial series about Arduino.
Arduino is the most famous board in the world for the maker, student and also professional people that want to experiment their embedded projects.
One of the reasons why Arduino is so famous is because of there a lot of libraries out there and it’s extremely fast to prototype your ideas.
In this tutorial we will see how to blink a led using three different ways:
- Arduino Ide or Visual Micro (An Arduino Ide inside Visual Studio)
- Proteus: an electronic design program that permits you to simulate an Arduino board.
- Simulink to deploy the code directly into the board.
Bill of Materials:
- Arduino board
- LED
- Resistor of 220ohm
- Wires
Program utilized:
- Proteus (Optional)—>Here you can download the libraries for Proteus 🙂
- Simulink (Optional)
Connection Diagram:
Source Code
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | uint8_t LED=9; //The setup function runs once when you press reset or power the board void setup() { // Initialize digital pin 9 as an output. pinMode(LED, OUTPUT); } // The loop function runs over and over again forever void loop() { digitalWrite(LED, HIGH); // turn the LED on (HIGH is the voltage level) delay(200); // wait for a second digitalWrite(LED, LOW); // turn the LED off by making the voltage LOW delay(500); // wait for a second } |
An uin8_t is a 8bit data type.
The function void setup() is used to preconfigure your hardware.
The pin 9 (assigned to LED variable) is configured as an output —-> pinMode(LED, OUTPUT);
The function void loop() is a function that is called cyclically as specified in the source code’s comment.
VideoTutorial