Homework 1
Description
Create a blinking LED
Components
LED light
Board
Resistor
Code
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
void setup() {
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}
void loop() {
/*
Blink
Turns on an LED on for five seconds, then off for two seconds, repeatedly.
Components Used:
LED, 220 ohm resistor, arduino board.
Components Used
LED, 220 ohm resistor
[Note: I used yellow instead of black wire for GND]
Arduino Code
Description
I modified the standard blinking LED program so that it will blink 1 long and 2 short, all with equally spaced downbeats (i.e. when the LED turns on) like a waltz.
Components used
Code
Description: Create a circuit with an LED that blinks SOS in Morse code
Components: LED, resistor
Arduino code: