I have wired up a common anode rgb led to my raspberry Pi. I dont understand why its not lighting up. My setup is this:
- 5v to rgb anode
- rgb to pi pins ( 5,6,26)
My code is
const Gpio = require('pigpio').Gpio;
const ledR = new Gpio(6, {mode: Gpio.OUTPUT});
const ledG = new Gpio(5, {mode: Gpio.OUTPUT});
const ledB = new Gpio(26, {mode: Gpio.OUTPUT});
var dutyCycle = 200;
ledR.pwmWrite(dutyCycle);
ledG.pwmWrite(dutyCycle);
ledB.pwmWrite(dutyCycle);
I even tried setting dutyCycle to 0. What am I doing wrong and how should I fix it?
Kind of hard to take photos because of the raspberry pi explore hat.There is red and green wire coming from gpio 5,6 and the blue wire coming from gpio 26(far right). The power is coming from the red wire(far left). If one of the gpio pins were loose (gpio 6 for red) would that stop the whole led from working?
pigs w 5 0 w 6 0 w 26 0
should switch the LED full on.