This photoresistor is dimming a PWMpin which is connected via three shift registers which in total have 21 different leds that are being dimmed.
This is working fine.
I then wanted to include one more led but i'm out of outputs on my shift registers. I then thought I could use one of the remaining digital outputs on my arduino which has a PWM function and dim that one aswell.
Problem is that the led on this digital output behaves different and opposite of the other ones.
Why is this happening?
I've listet a shot snap of my code below.
I'm using a 470 ohm resistor with the photoresistor. I've read that 10K is optimal but this i what i had.
int ledjorun = 3;
int HourButtonPin=5;
int PWMPin = 9;
int lightPin = 0; //define a pin for Photo resistor
const byte switchPinminute = 2;
const byte switchPinhour = 4;
pinMode(ledjorun, OUTPUT);
Try connecting the new LED to 5v through the resistor to your output pin.
Or if that's what you're already doing.
Try connecting the new LED to GND through the resistor to your output pin.
KenF:
Try connecting the new LED to 5v through the resistor to your output pin.
Or if that's what you're already doing.
Try connecting the new LED to GND through the resistor to your output pin.
wow that worked!
Im currently using LED to 5V through the resistor to my output pin.
Just tried to do the LED to GND through the resistor to my output pin and it's working!