serial "print" failing to uLCD-32PTU, anyone??
NeilRogers
Posts: 12
i have not gotten responses before, so trying again.
I have a propeller activity board and a microLCD Picaso display. i am trying to use dprint(LCD, [command]); and not response.
i have gotten:
serial *lcd = fdserial_open(14, 13, 0, 9600);
fdserial_txChar(lcd, 0xFF);
fdserial_txChar(lcd, 0xCD);
ch=fdserial_rxReady(lcd);
to work. the problem is that just clears the screen, to make a button that says PROD:
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x11);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0xC6);
c=fdserial_txChar(lcd1, 0x18);
c=fdserial_txChar(lcd1, 0xFA);
c=fdserial_txChar(lcd1, 0x20);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x01);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x04);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x03);
//c=fdserial_txChar(lcd, 0x00); //"
c=fdserial_txChar(lcd1, 'P'); //P
c=fdserial_txChar(lcd1, 'R'); //R
c=fdserial_txChar(lcd1, 'O'); //O
c=fdserial_txChar(lcd1, 'D'); //D
c=fdserial_txChar(lcd1, 0x00); //'"'); //0x22); //"
pause(1000);
ch=fdserial_rxReady(lcd1);
(passed to a function, called lcd1 in the function)
so that all works, but i need a way to read in a touch, that is better than this:
c=fdserial_txChar(lcd1, 0xFF);
c=fdserial_txChar(lcd1, 0x37);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x01);
ch=0;
for(int x=0; x<=2; x=x+1) {
ch=fdserial_rxReady(lcd1);
//ch=fdserial_rxChar(lcd);
// pause(1000);
print("X= %d,loop= %d \n",ch,x);
ch=0;
}
that is my bigger problem. Thoughts?
Neil
I have a propeller activity board and a microLCD Picaso display. i am trying to use dprint(LCD, [command]); and not response.
i have gotten:
serial *lcd = fdserial_open(14, 13, 0, 9600);
fdserial_txChar(lcd, 0xFF);
fdserial_txChar(lcd, 0xCD);
ch=fdserial_rxReady(lcd);
to work. the problem is that just clears the screen, to make a button that says PROD:
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x11);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0xC6);
c=fdserial_txChar(lcd1, 0x18);
c=fdserial_txChar(lcd1, 0xFA);
c=fdserial_txChar(lcd1, 0x20);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x01);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x04);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x03);
//c=fdserial_txChar(lcd, 0x00); //"
c=fdserial_txChar(lcd1, 'P'); //P
c=fdserial_txChar(lcd1, 'R'); //R
c=fdserial_txChar(lcd1, 'O'); //O
c=fdserial_txChar(lcd1, 'D'); //D
c=fdserial_txChar(lcd1, 0x00); //'"'); //0x22); //"
pause(1000);
ch=fdserial_rxReady(lcd1);
(passed to a function, called lcd1 in the function)
so that all works, but i need a way to read in a touch, that is better than this:
c=fdserial_txChar(lcd1, 0xFF);
c=fdserial_txChar(lcd1, 0x37);
c=fdserial_txChar(lcd1, 0x00);
c=fdserial_txChar(lcd1, 0x01);
ch=0;
for(int x=0; x<=2; x=x+1) {
ch=fdserial_rxReady(lcd1);
//ch=fdserial_rxChar(lcd);
// pause(1000);
print("X= %d,loop= %d \n",ch,x);
ch=0;
}
that is my bigger problem. Thoughts?
Neil
Comments
Use fdserial_rxReady(lcd) to see if a byte is available. If you know a byte should be coming, don't don't bother, but it could be used for a timeout.
well i am being whiny about having to have 10+ lines of code for everything on the screen, rather than just a "string" of hex codes or command with arguments.
i am concerned that i am not reading the x/y position consistently, most of the time it does not register a press, never seen it see a release. i have done the fdserial_rxReady(lcd); and fdserial_rxChar(lcd); with mixed results.
I am wondering if i would be better to program the display with the 4dLabs stuff, then communicate what is done. (basically starting it all over, i am not that far so it would not be a huge deal) the other advantage of that would be i am at 16,688 bytes with a clear screen and three buttons.. that code and images can all be on the display's 2 gb card.
or
do i switch to ardino for display purposes, since i have examples for that.
Neil
I don't have one of these LCDs, and don't plan to buy one. They are an attractive light-switch panel replacement for home automation though ....