Tim,
I'm trying to run your code to build a similar kind of thing, but the sketch won't compile for me (using Arduino 0011). First I got this error:
22: error: invalid suffix "b11101100100010" on integer constant
That was on the line:
case 'A': return 0b11101100100010;
So, I changed all the '0b's to B in each of the binary formatted integers for the two switch statements. Then I got this error:
In function 'unsigned int LineOne(char)':
error: 'B11101100100010' was not declared in this scope
I have no idea how to get around that one. Is that even the right syntax? I found a few references to that B prefix instead of 0b, but I'm still pretty new to this so I may be way off.
Here is my modification to the sketch so far:
// definitions for 14 segment chars
unsigned int LineOne(char index) {
switch (index) {
case 'A': return B11101100100010;
case 'B': return B11110010101000;
case 'C': return B10011100000000;
case 'D': return B11110010001000;
case 'E': return B10011100100010;
case 'F': return B10001100100010;
case 'G': return B10111100100000;
case 'H': return B01101100100010;
case 'I': return B10010010001000;
case 'J': return B01110000000000;
case 'K': return B00001101010010;
case 'L': return B00011100000000;
case 'M': return B01101101000001;
case 'N': return B01101100010001;
case 'O': return B11111100000000;
case 'P': return B11001100100010;
case 'Q': return B11111100010000;
case 'R': return B11001100110010;
case 'S': return B10110100100010;
case 'T': return B10000010001000;
case 'U': return B01111100000000;
case 'V': return B00001101000100;
case 'W': return B01101100010100;
case 'X': return B00000001010101;
case 'Y': return B00000001001001;
case 'Z': return B10010001000100;
default: return B00000000000000;
}
}
// definitions for 7 segment displays
unsigned int LineTwo(char index) {
switch (index) {
case '0': return B1111110;
case '1': return B0110000;
case '2': return B1101101;
case '3': return B1111001;
case '4': return B0110011;
case '5': return B1011011;
case '6': return B0011111;
case '7': return B1110000;
case '8': return B1111111;
case '9': return B1111011;
case 'H': return B0110111;
case 'L': return B0001110;
case '-': return B0000001;
default: return B0000000;
}
}