Lab 1 – Blink

Description

I used Arduino with a red LED. I changed the code to lighting up for 0.1 seconds and then off for 0.1 seconds, and then lighting up for 0.5 seconds, and then off for 0.5 seconds.

Components

  • 1 Arduino
  • 1 LED
  • 1 Resistor (220Ω)
  • 3 Jumper wires
  • 1 USB cable
  • 1 Breadboard

Code

// the setup function runs once 
when you press reset or power the board
void setup() {
 pinMode(13, OUTPUT);
}

// the loop function runs over 
and over again forever
void loop() {
 digitalWrite(13, HIGH); 
 delay(100); 
 digitalWrite(13, LOW); 
 delay(100); 
 digitalWrite(13, HIGH); 
 delay(500); 
 digitalWrite(13, LOW); 
 delay(500); 
}

Leave a Reply