Arduino Microcontroller Variables and Data Types




Today we are going to talk about Variables or Functions and Data Types.

Variable is the name we can assign a value to. If we say "18 = A" then the name we have given to this 18 is "A". As you may recall in the previous lesson, in section 5, the LED was blinking. That's where we use a variable. In this case, the 13th pin has the variable named LED and it is named. This means that after we write a variable in the code, we can use the 13 pin of the code to use the LED.

Data Types: -
It is also important to be aware of Data Types when using variables. The type of data we substitute for a variable is the type of data that we replace with a decimal number and a negative number.
The following are the main types of data types we can use in Arduino.
byte, int, long, float

#byte: -
Only 0 to 255 or 8bit digits can be substituted. But you can't put decimal places. That is the code we wrote in section 5: "int LED = 13;" code "byte LED = 13;" We can write. Because 13 is a decimal place with 0 to 255 numbers, you can do that. Now you may have noticed that when I say int, program is the starting point, it's not. int is also a data type.

#int: -
-32,768 to +32,767, or just a 16 bit numeric value. But you can't put decimal places here.

#long: -
Only 32bit digital values, from -2,147,483,648 to +2,147,483,648, can be replaced. But there is no decimal place here. That means the code can be written as "long LED = 13;"

#float: -
You can put decimal places in this date type. So the previous code could be written as "float LED = 13;"



Post a Comment

0 Comments