In which language do you program an Arduino?
The programming language that Arduino is very similar to C ++, a common language in the computer world.
The code you learn to write for Arduino will be very similar to the code you write in another computer language. All basic concepts remain the same, it is really just a matter of learning to work with a different dialect.
When writing code for microcontrollers, performance is very important. That is why you must have strong and fast programming languages. C and C ++ are among the most powerful languages you can find.
These are quite fast and stable, so they are a good choice for microcontrollers.
The compiler used to convert code into object files is avr-g ++.
Then a program called avrdude is used to upload the program to the Arduino microcontroller.
The Arduino programming language can be divided into three main parts: functions, values (variables and constants) and structure.
The writing of the Arduino codes is done in English. For this reason, we will name the sections below in English.
Functions
Functions are used to control the Arduino board and to perform calculations.
The functions are indicated in orange in the code.
Digital I / O
Advanced I / O
noTone ()
pressIn ()
press InLong ()
shiftIn ()
shiftOut ()
tone ()
Bits and bytes
bit()
bitClear ()
bitRead ()
bitSet ()
bitWrite ()
highByte ()
lowByte ()
Analog I/O
Zero, Due & MKR Family
External Interrupts
Interrupts
Random Numbers
Variables
Variables are Arduino data types and constants.
The variables are indicated in blue in the code.
Constants
floating point constants
Integer constants
HIGH | LOW
INPUT | OUTPUT | Input_pullup
LED_BUILTIN
true | false
Conversion
(unsigned int)
(unsigned lung)
byte()
char ()
float ()
int ()
long ()
become()