It's maybe a simple question but I can't figure it out: I have four transistors driving 4 different banks of leds. I have one potentiometer hooked up to the analog input A0. I want to switch through the colours as I sweep the pot. So e.g. 0 - 255 = Transistor 1 high, others low, 256 - 511 Transistor 2 high, others low and so on.
void loop(){
potvalue=analogRead(A0);
if (potvalue>=0 and potvalue<=255){digitalwrite (LED1, High (assuming High - on);}
else {digitalwrite (LED1, Low (assuming High - on);}
repeat for 255-511,512-767, 768-1023 or as you see fit
}