Arduino Complete Command Notes
Program Structure
Command Function
setup() Runs once when Arduino starts
loop() Runs continuously after setup
Pin Control Commands
Command Function
pinMode(pin, mode) Sets pin as INPUT, OUTPUT, or INPUT_PULLUP
digitalWrite(pin, HIGH/LOW) Sets digital output HIGH or LOW
digitalRead(pin) Reads digital pin state
Analog Commands
Command Function
analogRead(pin) Reads analog value (0-1023)
analogWrite(pin, value) Outputs PWM signal (0-255)
Timing Functions
Command Function
delay(ms) Pauses program for milliseconds
delayMicroseconds(us) Pauses program for microseconds
millis() Returns milliseconds since program started
micros() Returns microseconds since program started
Serial Communication
Command Function
[Link](speed) Starts serial communication
[Link]() Prints data without new line
[Link]() Prints data with new line
[Link]() Checks if data is available
[Link]() Reads incoming serial data
Math & Utility Functions
Command Function
map() Converts value from one range to another
constrain() Limits value within range
abs() Returns absolute value
min() Returns smaller value
max() Returns larger value
sqrt() Square root calculation
pow() Power calculation
Data Types
Type Description
int Integer numbers
float Decimal numbers
char Single character
bool True or False
byte 0-255 number
long Large integer number