Hi all,
I've got a BV4618 with keypad and lcd, but I can't for the life of me get the keypad working. I've had it working once, and then it stopped working and I can't spot what's different. Can anyone help?
My basic code is as so...
#include <bv4618_I.h>
#include <Wire.h>
BV4618_I di(0x31);
void setup()
{
// set up display geometry
di.setdisplay(4,20);
// set up keyboard scan codes, alter the above constant array
// this will depend on how the keypad has been wired
const char kb[]={0x7d,0xee,0xed,0xeb,0xde,0xdd,0xdb,0xbe,0xbd,0xbb,0xe7,0xd7,0xb7,0x77,0x7e,0x7b};
di.setkeycodes(kb);
// clear screen
di.cls();
}
void loop()
{
char tmp;
di.puts("Display Test");
di.rowcol(2,1);
while(1) {
if(!di.keyint()) {
tmp=di.key();
if(tmp > 9) tmp+='A'-10;
else tmp+='0';
di.putch(tmp);
di.putch(' ');
}
}
while(1);
}
...which is essentially the sample code. One thing I've noticed is the address I need to use to get the lcd working (0x31) is different to the one in lots of the sample code (0x42) and to what comes up when the lcd starts up (0x62) - but this seems to be the only one that works for the screen. Any advice very gratefully received!
M.