Arduino
Arduino
The data types are used to identify the types of data and the associated functions for handling the data. The
data types that we will use in the Arduino are listed below:
• void Data Type
• int Data Type
• Char Data Type
• Float Data Type
• Double Data Type
• Unsigned int Data Type
• short Data Type
• long Data Type
• Unsigned long Data Type
• byte data type
• word data type
void Data Type
• The void data type specifies the empty set of values and only used to
declare the functions. It is used as the return type for the functions that
do not return any value.
• Example:
Int Data Type
• The integer data types are the whole numbers like 5, -6, 10, -123, etc.
They do not have any fractional part. The integer data types are
represented by int.
• Example:
Char Data Type
• The char datatype can store any number of character set. An identifier
declared as the char becomes a character variable.
• Example:
Float Data Type
• A number having the fractional part and a decimal part is considered
as a floating-point number. For example, 4.567 is a floating-point
number.
• Example:
Double Data Type
• The double data type is also used for handling the decimal or floating-
point numbers. It occupies twice as much memory as float.
• Example:
Arduino while loop
• The while loop() is the conditional loop that continues to execute the code inside the parentheses until the
specified condition becomes false.
• The while loop will never exit until the tested condition is changed or made to stop. The common use of a
while loop in Arduino includes sensor testing, calibration (calibrating the input of sensor), variable
increment, etc.