First issue: I have a byte array "alpha" where each row is a letter (ie alpha[0][] is A with ASCII code 65)
byte alpha[][6] =
{
{B01111110, B10010000, B10010000, B10010000, B01111110, B00000000}, // A - 65
{B11111110, B10010010, B10010010, B10010010, B01101100, B00000000}, // B - 66
{B01111100, B10000010, B10000010, B10000010, B01000100, B00000000}, // C - 67
{B11111110, B10000010, B10000010, B10000010, B01111100, B00000000}, // D - 68
{B11111110, B10010010, B10010010, B10010010, B10000010, B00000000}, // E - 69
{B11111110, B10010000, B10010000, B10010000, B10000000, B00000000}, // F - 70
{B01111100, B10000010, B10001010, B10001010, B01001110, B00000000}, // G - 71
{B11111110, B00010000, B00010000, B00010000, B11111110, B00000000}, // H - 72
{B00000000, B10000010, B11111110, B10000010, B00000000, B00000000}, // I - 73
{B00000100, B00000010, B00000010, B00000010, B11111100, B00000000}, // J - 74
{B11111110, B00010000, B00101000, B01000100, B10000010, B00000000}, // K - 75
{B11111110, B00000010, B00000010, B00000010, B00000010, B00000000}, // L - 76
{B11111110, B01000000, B00110000, B01000000, B11111110, B00000000}, // M - 77
{B11111110, B00100000, B00010000, B00001000, B11111110, B00000000}, // N - 78
{B01111100, B10000010, B10000010, B10000010, B01111100, B00000000}, // O - 79
{B11111110, B10001000, B10001000, B10001000, B01110000, B00000000}, // P - 80
{B01111100, B10000010, B10001010, B10000100, B01111010, B00000000}, // Q - 81
{B11111110, B10010000, B10011000, B10010100, B01100010, B00000000}, // R - 82
{B01100100, B10010010, B10010010, B10010010, B01001100, B00000000}, // S - 83
{B10000000, B10000000, B11111110, B10000000, B10000000, B00000000}, // T - 84
{B11111100, B00000010, B00000010, B00000010, B11111100, B00000000}, // U - 85
{B11111000, B00000100, B00000010, B00000100, B11111000, B00000000}, // V - 86
{B11111110, B00000100, B00011000, B00000100, B11111110, B00000000}, // W - 87
{B11000110, B00101000, B00010000, B00101000, B11000110, B00000000}, // X - 88
{B11000000, B00100000, B00011110, B00100000, B11000000, B00000000}, // Y - 89
{B10000110, B10001010, B10010010, B10100010, B11000010, B00000000}, // Z - 90
{B01111100, B10001010, B10010010, B10100010, B01111100, B00000000}, // 0 - 48
{B00000000, B01000010, B11111110, B00000010, B00000000, B00000000}, // 1 - 49
{B01000110, B10001010, B10010010, B10010010, B01100000, B00000000}, // 2 - 50
{B01000100, B10000010, B10010010, B10010010, B01101100, B00000000}, // 3 - 51
{B00011000, B00101000, B01001000, B11111110, B00001000, B00000000}, // 4 - 52
{B11100100, B10100010, B10100010, B10100010, B10011100, B00000000}, // 5 - 53
{B00111100, B01010010, B10010010, B10010010, B10001100, B00000000}, // 6 - 54
{B10000000, B10001110, B10010000, B10100000, B11000000, B00000000}, // 7 - 55
{B01101100, B10010010, B10010010, B10010010, B01101100, B00000000}, // 8 - 56
{B01100100, B10010010, B10010010, B10010010, B01111100, B00000000}, // 9 - 57
{B00000000, B00000000, B00000000, B00000000, B00000000, B00000000}, // Blank - 32
{B00010000, B00010000, B00010000, B00010000, B00010000, B00000000}, // Dash - 45
{B10010010, B10010010, B10010010, B10010010, B10010010, B00000000} // Error
};
I want to read a character array such as
char myMessage[] = "AAAA";
and have it append each letter's ASCII code (ie for AAAA --> message = {65, 65, 65, 65}
int message[sizeof(myMessage)]; //this would be int message[5] for AAAA with the null character
void appendMessage(int message[])
{
for (int i = 0; i < sizeof(myMessage); i++)
{
message[i] = myMessage[i];
}
}
Is this the proper approach or is there a better way to handle this.
Second issue: Is there any way I can create a dictionary to allow me to read A (ASCII 65) and have that equate to 0, B (ASCII 66) = 1, etc for my alpha array above.
Any help or pointers is appreciated.