Content tagged with LED
Arduino Tutorial: Use PC to Blink an LED
/* Blinking LED (This code is for Arduino!)
* ------------
*
* turns on and off a light emitting diode(LED) connected to a digital
* pin, based on data coming over serial
*/
int ledPin = 13; // LED connected to digital pin 13
int inByte = 0;
void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
Serial.begin(19200); // initiate serial communication
}
void loop()
{
while (Serial.available()>0) {
inByte = Serial.read();
}
if (inByte>0) {
digitalWrite(ledPin, HIGH); // sets the LED on
} else {
digitalWrite(ledPin, LOW); // sets the LED off
Submitted by seandockray on 16 October 2006 - 4:31pm.
LED Basics
Lots of information about LED's, covering their power consumption, directionality, etc. It answers pretty much all of the questions that people have when they first start playing around with the little guys.
Submitted by seandockray on 8 October 2006 - 6:31pm.
