Code:
static unsigned int ASCII_Offsets[73] = {0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,
0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x1000,0x00F1,0x00810x0001,0x0030,0xFF00,0xFFFF,
0x0002,0xB482,0x0010,0x1800,0x7F00,0x8F00,0x0004,0x0011,
0x0080,0xA800,0x0100,0x0800,0x0008,0x1C00,0x00F0,
0x0020,0xE080,0xC080,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x1000,0x00F1,0x0081,0x0001,0x0030,0xFF00,0xFFFF,
0x0002,0xB482,0x0010,0x1800,0x7F00,0x8F00,0x0004,0x0011,
0x0080,0xA800,0x0100,0x0800,0x0008,0x1C00,0x00F0,
0x0020,0xE080,0xC080};
// Don't worry about the numbers in the array and, sorry, I can see they are a little bit mucked up with the
formatting. Also the 0x0000 terms are just ones that I haven't computed yet.
difference = ledval - 48; //provides an offset and set ASCII '0' to element 0 of array.
motors = ASCII_Values[difference]; //gets the values for the required motors that need to be switched on for
specific characters.