it is the program written in the Arduino IDE that runs on an Arduino board.
a sketch
called once when the Arduino board is powered on or reset. It is used to initialize variables, set pin modes, and perform any necessary setup tasks.
setup() function
called repeatedly after the setup() function. It contains the main code that will run continuously on the Arduino board.
loop() function
these are lines in your code that are not executed. They are meant for explaining the code, providing context, or leaving notes for yourself or others.
comments
what are the 2 types of comments
used to store and manipulate data in a program.
variables
common data types include?
scope of variable that declares outside functions and accessible throughout the program.
global variables
scope of variable that declares inside a function and only accessible within that function.
local variables
special symbols in C++ that perform operations on variables and values.
operators
what are the categories of operators?
used to perform basic mathematical operations.
arithmetic operators
used to compare two values.
relational operators
used to combine multiple conditions. They include logical AND (&&), logical OR (||), and logical NOT (!).
logical operators
used to assign a value to a variable.
assignment operators
used to increase or decrease the value of a variable by 1.
increment (++) and decrement (–) operators
allow a program to make decisions and execute different code paths based on whether a condition is true or false.
conditional statements
it is useful for iterating over a range of values or repeating a set of instructions a specific number of times.
for loop
this continuously executes a block of code as long as a specified condition remains true
while loop
This command initializes the Serial communication at a specified baud rate (e.g., 9600).
Serial.begin(baud_rate)
This command sends data to the Serial Monitor followed by a newline character.
Serial.println(data)
Similar to Serial.println(), but it does not append a newline character at the end.
Serial.print(data)
Reads incoming serial data.
This command retrieves the first byte of incoming serial data available and returns it as a character. If no data is available, it returns -1.
Serial.read()
Returns the number of bytes available to read from the serial buffer. This command helps determine if there is any incoming data before attempting to read it, preventing errors when no data is available
Serial.avaialble()