Getting Started with Arduino
Arduino is the most popular platform for beginners in robotics. Let's learn the basics!
Arduino Board Anatomy
- Digital Pins (0-13): Read/write HIGH or LOW signals
- Analog Pins (A0-A5): Read sensor values (0-1023)
- Power Pins: 5V, 3.3V, GND
- USB Port: Programming and power
Arduino Program Structure
// Arduino code has two main functions
void setup() {
// Runs ONCE when Arduino starts
pinMode(13, OUTPUT); // Set pin 13 as output
Serial.begin(9600); // Start serial communication
}
void loop() {
// Runs REPEATEDLY forever
digitalWrite(13, HIGH); // Turn LED ON
delay(1000); // Wait 1 second
digitalWrite(13, LOW); // Turn LED OFF
delay(1000); // Wait 1 second
}
First Project: Blinking LED
Components needed:
- Arduino Uno board
- LED
- 220Ω resistor
- Breadboard and jumper wires
Circuit:
- Connect LED long leg (anode) to Arduino pin 13
- Connect 220Ω resistor to LED short leg (cathode)
- Connect resistor other end to GND
Installing Arduino IDE
- Download from arduino.cc
- Install the software
- Connect Arduino via USB
- Select Board: Tools → Board → Arduino Uno
- Select Port: Tools → Port → (your Arduino port)
- Click Upload button
✅ Success! If your LED blinks, congratulations! You've programmed your first Arduino project.