🦾Arduino
Last updated
Last updated
If you are starting programming and want to give a try to electronics, Arduino is the perfect way in to get in. Arduino is easy to program/learn. Here will be some things to start with.
Arduino is an open-source electronics platform based on easy-to-use hardware and software.
Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online.
You can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming language (based on Wiring), and the Arduino Software (IDE), based on Processing.
You will start downloading the Arduino IDE and connecting your Arduino microcontroller with it.
Follow the following steps:
Go to Tools >> Boards and select what board you are using.
Go to Tools >> Port and select the Arduino port.
Once you did this you have connected your Arduino, and you can start programming.
Arduino was made with c++, and is a simplified language, if you have been experienced c++, c or c# programming you will learn this so much faster.
Here is the documentation:
Let's start with the built in led in the Arduino to demonstrate.
Variables are a defined storage of data that can be an integer, decimal, characters, Booleans. Imagine box that you put something like a phone or papers.
Functions are basically piece of code design/programmed to do instructions/actions in your program. In this case the functions in this program are setup() and loop().
We assign to the functions specific parameters that can be stored on a variable and pass to the function to make the specified actions.
setup() - this function is necessary to initialize and tell the Arduino what we are going to use.
loop() - the loop function will repeat consecutively in the microcontroller.
Is a function of Arduino that lets you turn on or turn off a specific electronic component. In this case the led of the Arduino.
HIGH - Means Turn ON
LOW - Means Turn OFF
The delay() func, is to tell the microcontroller that we want to stop some time that can be 1, more or minus. In this case we are defining the delay in a global variable called dot.
Now how you upload this code to the Arduino? In the IDE there is a checker to check if you have an error in your code before you uploaded. You check your code first, after that click the arrow to upload the code.
In this case we are using the led to output information to it, we are sending them instructions.
In case we define Input, we are receiving information threw a component and using that info to further use.
Great !! Now look at your Arduino board.
Here you will find some of my projects that I do with the Arduino that you can use to build a more difficult circuits or improve your programming knowledge.