Analog I/O & Serial Communication
|
Reads the value from the specified analog pin (0 to 1023).
|
|
Writes an analog value (PWM signal) to a pin (0 to 255). Only works on PWM enabled pins (marked with ~ on the board).
|
|
Configures the reference voltage used for analog input (DEFAULT , INTERNAL , EXTERNAL ).
|
|
Initializes serial communication at the specified baud rate (e.g., 9600, 115200).
|
|
Sends data to the serial port as human-readable ASCII text.
|
|
Sends data to the serial port, followed by a carriage return and line feed.
|
|
Gets the number of bytes (characters) available for reading from the serial port.
|
|
Reads the first available byte of incoming serial data.
|
|
Pauses the program for the amount of time (in milliseconds) specified as parameter.
|
|
Returns the number of milliseconds since the Arduino board began running the current program. This number will overflow (go back to zero) after approximately 50 days.
|
|
Returns the number of microseconds since the Arduino board began running the current program. This number will overflow (go back to zero) after approximately 70 minutes.
|
Control Structures & Operators
if (condition) { ... } - Executes code block if the condition is true.
|
if (condition) { ... } else { ... } - Executes one code block if the condition is true and another if the condition is false.
|
for (initialization; condition; increment) { ... } - Repeats a block of code a specific number of times.
|
while (condition) { ... } - Repeats a block of code as long as the condition is true.
|
do { ... } while (condition); - Executes a block of code once, and then repeats as long as the condition is true.
|
switch (expression) { case value1: ... break; case value2: ... break; default: ... } - Selects one of several code blocks to execute based on the value of an expression.
|
|
Assignment operator (assigns a value to a variable).
|
|
Equality operator (checks if two values are equal).
|
|
Inequality operator (checks if two values are not equal).
|
|
|
|
|
|
Logical AND operator (returns true if both conditions are true).
|
|
Logical OR operator (returns true if at least one condition is true).
|
|
Logical NOT operator (reverses the logical state of its operand).
|
|
|
|
|
|
|
|
|
|
Modulo (returns the remainder of a division).
|