I have a problem and was wondering if anyone could please help me.
I am trying to blink two LEDs simultaneously at different rates, each LED with its own parallel circuit and programme (I have included the code which I used down below). The only thing is that when I upload the programme nearly all the current goes to the the first LED (Pin 9), whereas almost none goes to the other LED (Pin 8).
Does anyone know of a way that I can distribute the current evenly to each pin?
Any help would be very much appreciated.
Thanks
Tim
Here is the code that I am using:
const int ledPin = 9;
const int led = 8;
int ledState = LOW;
int ledstate = LOW;
long previousMillis = 0;
long previousmillis = 0;
long interVal = 1000;
long interval = 2000;
Sorry, I made a mistake with typing the code out onto this forum. It was supposed to say led pin 9 instead of 13. All the current seems to go to the first pin, even though both leds are on parallel circuits and have the same resistor.
I have attached a schematic highlighting the way I have wired up the circuit. I am trying to get equal amounts of current going to each LED, therefore they will hopefully both light up with equal brightness.
Thanks, that completely fixed it. I cant believe I missed that, sorry, kinda new to this.
Do you know of any way that I can run this programme but have two 'sequences' of LEDs running simultaneously? Almost like two 'for' loops running simultaneously.
The standard answer to your question is to look at the blink without delay example. Unusually, this does not apply in your case - you're already using millis rather than delays to do your timing. Just replicate what you have for your second sequence but use different variables to keep track of when you last did stuff on the new sequence.