โ Arduino learning pathArduino ยท Module 2 of 10
Sketch structure and blinking LED
Write your first program.
๐ Key ideas
- setup() runs once at start; loop() repeats forever.
- pinMode(13, OUTPUT); configures a pin.
- digitalWrite(13, HIGH/LOW) turns an LED on/off.
- delay(1000) pauses 1 second.
- Use a resistor (220โ330ฮฉ) with external LEDs.
๐ก Real-life example: setup() is getting ready in the morning; loop() is the daily routine repeated forever.
setup()Runs once at startup
loop()Runs repeatedly
pinModeSets pin direction
digitalWriteSets a pin HIGH or LOW