Hello arduinians
I got my self an UNO on saturday and I've had some fun learning a shed loads about electronics and this is comming from an IT technician as it is my day job
I'm still in the beginner stages so I'm working with simple circuits still, in my current project I have 2 RGB leds and I wish to light up 2 colors on each so figured I'd modify my first bliking white code just blink ( or at least at this stage keep them on for testing.
my code was this
for(int i = 0; i < 6; i++)
and I changed it to this so I could basiclly ignore the green pins in my project.
void loop() {
//I want 0 2 3 & 5
for(int i = 0; i < 6 && i == 0 || 2 || 3 || 5; i++)
{
digitalWrite(ledpins[i], 0);
}
}
I'm using 6 pins on PWM ( which I will later play with for fading) which goes to each color so my var ledpins is an array of 6 refering to each pins and 0 2 3 5 are red and blue.
I uploaded this code but it just light all of them up as if it ignores my OR operators but I'm guessing I'm using || wrong. I've tried a serach but havnt found any similar for loop
Thanks
RageRiot