Assignment: Introduction to Arduino and Physical Computing
Collaborators:
Description
Use the Arduino to control a light emitting diode and make it blink in different rate.
Components Used
- Light Emitting Diode (LED)
- Resistor
Arduino Code
int ledPin = 13; // LED connected to digital pin 13
void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}void loop()
{
digitalWrite(ledPin, HIGH); // sets the LED on
delay(3000); // waits for 3 seconds
digitalWrite(ledPin, LOW); // sets the LED off
delay(1000); // waits for 1 second
}
Item