I'm using the mbed to talk to a lcd screen lcd03 (details below)
http://www.robot-electronics.co.uk/htm/Lcd03tech.htm
I'm using I2C and can send commands to the screen happily using the following
const int lcdAddress = 0xC6;
char cmd[2];
cmd[0] = 0x0;
cmd[1] = 0xD;
i2c.write(lcdAddress, cmd, 2);
I'm now trying to read data back form the lcd screen (it has built in keypad connections) which should just return a byte value for the registers 0x01 and 0x02.
I have tried sending the following code, but seem to get the same thing back every time (no matter what buttons are pressed, and what register I send) which makes me think the data I'm getting back isn't right
const int lcdAddress = 0xC6;
int var[1] = 0x01;
int varResult[1];
i2c.write(lcdAddress, var, 1);
i2c.read(lcdAddress, varResult, 1);
pc.printf("%x", varResult);
I put the %x in there to force the display to output the hex value, rather than the ascii response.
I assume I have the basics right here...
I would expect to see back either 0x00 (no buttons pressed) or something like 0x01, 0x02, 0x04, 0x08 etc...
I'm using the mbed to talk to a lcd screen lcd03 (details below)
http://www.robot-electronics.co.uk/htm/Lcd03tech.htm
I'm using I2C and can send commands to the screen happily using the following
I'm now trying to read data back form the lcd screen (it has built in keypad connections) which should just return a byte value for the registers 0x01 and 0x02.
I have tried sending the following code, but seem to get the same thing back every time (no matter what buttons are pressed, and what register I send) which makes me think the data I'm getting back isn't right
I put the %x in there to force the display to output the hex value, rather than the ascii response.
I assume I have the basics right here...
I would expect to see back either 0x00 (no buttons pressed) or something like 0x01, 0x02, 0x04, 0x08 etc...