โ† Arduino learning path
Arduino ยท Module 2 of 10

Sketch structure and blinking LED

Write your first program.

๐Ÿ“– Key ideas

  1. setup() runs once at start; loop() repeats forever.
  2. pinMode(13, OUTPUT); configures a pin.
  3. digitalWrite(13, HIGH/LOW) turns an LED on/off.
  4. delay(1000) pauses 1 second.
  5. 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