At the moment I started flying radio controlled airplanes I also started getting
interested in electronics, it's very interesting to be able to control a
plane from the distance, it is something magical for me
with the introduction of racing drones this interest intensified even more
when I started to build my own
drones are realized that I needed to have a minimum knowledge to make the
connections correctly at the same time it was a great opportunity to start
learning a little better about electronics in general, components what
they are for circuits basic rules and then in that moment I discovered Arduino
that's when I got into the programming of microcontrollers and then everything changed
for now I keep learning and probably never finished learning about
this to start working with Arduino all you need to do is buy an Arduino or
equivalent board and download the Arduino IDE in your computer today I'm
going to help you get started with Arduino by giving you some
recommendations some tips and explain to you some things that you might find
confusion at first. I apply my knowledge of Arduino especially in my RC airplanes
and drones including an lighting system for our Narsee boat you can see that
video in the link that you see in the screen
but I've also used it fordifferent projects that don't have to do with airplanes or anything that is radio controlled
but this challenges are fun and during the process I learn new things
Arduino is an open-source platform which means that the hardware and software are
free to replicate and distribute that's why you can find Arduino clones at a
very low cost and the Arduino IDE is free thanks to the popularity of Arduino
you can find a lot of information and support in forums and tutorials Arduino
is designed for people who know nothing about electronics and programming and it
is considerably easier to learn than other complex programming environments
Arduino is not the only one in the community there are other similar brands
that are compatible with Arduino
but they all have a programmable microcontroller.
there are also preassembled models that
work as input or output peripherals that can be sensors lights among others
these answers can be used for a variety of tasks this sometimes come in
the form of the so called shields which makes it even easier to carry out a
project such as making a mobile phone or an mp3 player with your Arduino in
summary Arduino and development boards in general facilitate the use of a
microprocessor which is basically a mini computer that will run a program that we
do for our project either something simple or more complicated Arduino as
such is the company that has developed this project and is located in Italy and
continues to develop and sell its products that are of a wide variety the
Arduino Uno being the most popular board in the market we will find many boards
that are the same but with different names since the name Arduino can only be
used by the company in its original products now let's start with the tips
and recommendations to get started on this start learning everything you can
about electronic components what are they for and how to use them the best
way to learn is doing so I recommend buying an Arduino kit that includes the
basic components to make circuits of all kinds generally this includes some LEDs
capacitors resistors transistors cables a brad / integrated circuits buttons and
things like that the most accompany this with theory so you familiarize with the
symbols of the schematics so when you want to do your own circuits you'll know
how to read the schematic and speaking about making your own circuits this is
something you can do with jlc PCB with jlc PCB you can order up to 10 PCBs for
only $2 which is insane if it's your first time ordering with jlc PCB you
will have a $20 discount on shipping if your order is more than $7 so definitely
check them out I'll leave a link in the description now back to the tips a star
learning to write code and eight syntax to program you must follow some strict
rules so that the code works writing the code correctly is critical
if for example you forget to put a semicolon after a closing brackets or
misspell a line there will be an error when compiling or using the code so it's
very important to start learning these simple rules and start studying the
different functions this brings us to a question what programming language is
using Arduino the answer is the c and c++ language this is the language that
is used in the essence of arduino but actually when writing your code is
easier because they use per determine libraries to make life easier so we
don't have to write a large and confusing amount of code but we only
write just some lines to achieve the same however you could use c and c++
code directly into the iv'e without any problems let's talk a little bit more
about libraries a library can be composed of several files greeting in C
or C++ that give more functionality to your Arduino projects libraries are
those that allow you to write a very simple code without having much
programming knowledge into the C or C++ language since everything is written in
advance the only bad thing is that the libraries increase the size of the final
program and occupy more memory on the microchip but from now you shouldn't
worry about this since most of the time you won't have any problem with this
there are libraries of all kinds and many are developed by people or groups
that like to collaborate with the Arduino community to add a library to
most download it first and then add it from the menu if we see one of the
examples we see how it is include in the code with this declaration some
libraries are already included in the Arduino IDE called standard libraries
other libraries must be installed by you depending on your needs some libraries
are not compatible with all the Arduino boards and some are compatible only with
a specific Arduino models or microcontrollers and the last
recommendation that can give you is to have a lot of patience and practice a
lot so that you'll learn by doing many times you will find many problems but
this is totally normal so do not give up because there is always a solution you
just need to have the knowledge to start programming
I recommend studying the basic examples that are in
into the Arduino IDE you can copy the code of these examples and combine them
with others to build your own projects let's take a look at how to program the
use of a potentiometer to control the brightness of an LED digitally first
let's open the arduino ide if it's the first time you open this this file will
show up this is the bare minimum code necessary to start programming but let's
open an example that have all the necessary code to achieve what we need
we'll go to file examples and in the analog section or number three choose
and now log in out serial this sketch opens up which is the program we are
referring to at the top we have a comment that describe the code and even
describe what's needed for the circuit to be completed a little bit lower we
have a link to the Arduino website where you will find more information and a
tutorial now let's start with the actual code the first thing we notice are the
constants these are the pins that we are going to define as outputs and inputs
the input pin has to be an addict we can choose another one and we can change it
here the output pin has to be compatible with PWM signals then we have the
variables this are call variables because they value changes over time we
give them a name and their initial value in this case zero because this value
will change according to the value of the potentiometer and the value of the
LED light now let's go with a void setup the code inside void setup runs only
once after you turn on your Arduino right now we have the serial begin
command which is used to communicate with the computer so they are doing or
will send data to the computer and we can display the value collected from the
pots and show mirror in real time and finally we have the void loop this is
the main code of any program and it runs indefinitely that's why it's called loop
you may have noticed that at the beginning of each line of code there is
a comment describing what's the line below about these comments do not have
any effect on the code they're just a guide
in this part of the code we will see the variables and their functions that makes
the code work in this case we see that the variable sensor value will be equal
to the value of the reading of the potentiometer in output value we will
make a conversion of the value from the potentiometer since that value can vary
from 0 to 1023 but to light up our LED or control it we can only use a value
from 0 to 255 and that's why we use the function called map and then we use the
function analog right to write the value to an output pin in this case we used a
pin where our LED is connected and we use the value of our potentiometer that
was converted before and this way the LED will pride in the correct amount
according to the potentiometer position the next part of the code is to print
the data in the serial monitor this is not necessary to make the code work it
is just to see the real-time data in your computer so you could even delete
it and after that we have a delay of 2 milliseconds and there the code ends and
then it goes back to the first line of void loop and repeat the process this
process happens thousands of times per second and that's why it will look fluid
let's make the circuit real quick and then upload the program to the Arduino
to test it in future videos we can make more circuits like this but for now this
circuit is really easy to do before uploading the sketch to the Arduino make
sure that the right comport is selected then we hit upload and we wait until the
sketch is totally uploaded this takes few seconds your Arduino IDE will
indicate when the code is totally uploaded when it's done you can now open
the serial monitor if you want to see the real-time data while you move the
potentiometer and now we can see the results as you can see it was very easy
if you like writer controller airplanes drones and projects like this one then
consider subscribing for now I hope you like this video and I'll see you in the
next project