I am trying to understand shiftOut in my project and need some help.
I have a project that has several different momentary buttons. Depending on what button is pushed, a different LED will turn on/off.
I am trying to control this with shiftOut. The plan was to create an array that would hold 8 variables - one for each button - and then shiftOUt the array.
This is what I was thinking:
int button1 = 0;
int button2 = 0;
...
int button8 = 0;
int myArray[] = { button1, button2, button3, ... button8 }
// detect state of each button here, then shiftOut
shiftOut(data, clock, MSBFIRST, myArray[]);
I keep getting errors when I try to set up the array with a bunch of variables in it. I tried looking this up elsewhere but the discussions were way over my head.
Any help pointing me to a simple answer would be very appreciated.
If it helps, I am using an uno with a 74hc595.