Description
This first lab was an introduction to the Arudino programming environment.
Using the Arduino Uno I constructed a basic circuit that made an LED blink. I based my code off of the Blink LED code found on the arduino.cc site.
To show that I understood the processing language I changed the original code delay from 1000 (1 s) to 3000 (3 s). This meant that instead of the LED blinking every second, my red LED blinks every 3 seconds.
Components Used
1- Arduino Uno
1- Mini Breadboard
1- Red LED
1- 220 Ω Resistor
Code
/*
Hello World!
LED lab #1
using LED color
Resistance 220 ohm
*/
int ledPinR = 13; //LED connected to digital pin 13
void setup() //run once, when the sketch starts
{
pinMode(ledPin, OUTPUT); //sets the digital pin as output
}
void loop()
{
digitalWrite(ledPin,HIGH); //sets the LED on
delay(3000); //waits for three seconds
digitalWrite(ledPin,LOW);
delay(3000);
}
- Login to post comments