(Reference) LED
LEDs - Light Emitting Diodes
Wiring
- Anode (longer leg) connects to resistor and Photon 2
- Cathode (shorter leg) connects to
GND
Operation
HIGH
output turns LED onLOW
output turns LED off
Code
const int PIN_LED = D2; //pin D2
void setup() {
//initialize the pin mode
pinMode(PIN_LED, OUTPUT);
}
void loop() {
digitalWrite(PIN_LED, HIGH); //turn LED on
delay(100); //delay 100 ms
digitalWrite(PIN_LED, LOW); //turn LED off
delay(100); //delay 100 ms
}
Credits
- Afrank99 - Own work, CC BY-SA 2.0, Link
- CC BY-SA 3.0, Link
- Images created with Fritzing