Been playing with C for a week now and have managed to get i2c protocol working along with serial i2c LCD adaptor board. I was looking at the Nokia5110 LCD which uses a serial data communication to display stuff on the screen. I found some code that is used on the Auduino, and tried to use some of it but the way the character array is set up won't work in XC8.
Here is a little bit of code from the Auduino:
This is not accepted by XC8, but if I do
it will compile and the correct data is in the array.
How can this be done simpler and quicker, like in the Auduino code?
Here is a little bit of code from the Auduino:
Rich (BB code):
static const byte ASCII[][5] = {
{0x00, 0x00, 0x00, 0x00, 0x00} // 20
,{0x00, 0x00, 0x5f, 0x00, 0x00} // 21 !
,{0x00, 0x07, 0x00, 0x07, 0x00} // 22 "
,{0x14, 0x7f, 0x14, 0x7f, 0x14} // 23 #
,{0x24, 0x2a, 0x7f, 0x2a, 0x12} // 24 $
,{0x23, 0x13, 0x08, 0x64, 0x62} // 25 %
,{0x36, 0x49, 0x55, 0x22, 0x50} // 26 &
,{0x00, 0x05, 0x03, 0x00, 0x00} // 27 '
,{0x00, 0x1c, 0x22, 0x41, 0x00} // 28 (
,{0x00, 0x41, 0x22, 0x1c, 0x00} // 29 )
};
etc......
Rich (BB code):
const char byte[][5];
byte[0][0] = 0x00;
byte[0][1] = 0x01;
byte[0][2] = 0x02;
How can this be done simpler and quicker, like in the Auduino code?