I'm working with 17-segment (or in this case 16-segment because I'm taking out the decimal point to make things easier) alphanumeric LED displays, and want to have my code so that I can just change an array in calling the displayString function and it will interpret it and display it on the LEDs.
This is the code that defines the function:
void displayString(int string[]){
//there are some functions in here for the 74HC595 shift
//registers that are driving the segments as well
clearRegisters();
for(int i = 0; i < sizeof(string); i++){
switch(string[i]){
case 'A':
//I previously defined lists named A-Z with the pins of the
//display that should be lit for the according character
for(int x; x < sizeof(A); x++){
setRegisterPin(A[x] + (i * 16), HIGH);
}
case 'B':
for(int x; x < sizeof(B); x++){
setRegisterPin(B[x] + (i * 16), HIGH);
}
//etc...
}
}
writeRegisters();
}
And here is the part where I call the function:
void loop(){
displayString ({'A', 'B'});
delay(10);
}
And when I verify the program, I get the following
error: expected primary-expression before '{' token
I've tried some different syntax for calling it, none of which worked, but that could easily be where the problem lies and it's the only thing I can think of that would be causing this error. So, ultimately... does anyone know the syntax for doing this?