Week 1: Raspberry Led Control - mparra-mpz/week-of-code GitHub Wiki
Hardware Components
- Raspberry Pi 1 Model B+
- Assembled Pi T-Cobbler Plus
- Breadboard
- Led
- 220[Ω] Resistance
Software Components
Hardware Assembly
Connect the GPIO 21 to a 220[Ω] resistance, then connect the led's anode to the ground and finally connect the led's cathode to the 220[Ω] resistance.
Software Development
I suggest review the Raspberry Pi documentation in case of problems with the Raspberry Pi. Wiring Pi install documentation is very easy to follow, so we won't spent time on that. I suggest use the command gpio readall
to identify the GPIO scheme in the Wiring Pi configuration (In my case GPIO 21 is pin 29).
// Wiring Pi library setup.
wiringPiSetup();
// Set pin GPIO 21 (pin 29) as output.
pinMode(29, OUTPUT);
// Turn on the GPIO 21.
digitalWrite(29, HIGH);
// Turn off the GPIO 21.
digitalWrite(29, LOW);