I can't seem to figure this one out,
the scenario is, I have two shift registers connected to my arduino and 16 leds connected to them.
I have a boolean array of 16, then I wrote a function that writes the array to the shift registers. Thats what the writereg(); is
I can do neat things like:
for (int i = 1; i<16; i++){
registers[i] = high
}
writereg();
and one led will light up one after the other
But is there a way to light up specific multiple leds without a for loop in a single line of code?
The only thing I can think to do is:
registers[1] = HIGH;
registers[4] = HIGH;
registers[10] = HIGH;
registers[16] = HIGH;
writereg();
it would be neat if I could do something like this:
registers[1,4,10,16] = HIGH;
writereg();
anyone know, just curious if there is a less caveman approach to what I'm doing