LCD screen oLCD-32 and propeller activity board
NeilRogers
Posts: 12
I have a propeller activity board and a oLCD 32 PTU from 4d labs.
i can connect via serial connection in the 4d labs utility, and send hex code to set the values.
i am missing something, because i cannot get it to communicate with the fdserial.h like below:
#include "simpletools.h" // Include simple tools
#include "simpletext.h"
#include "fdserial.h"
int main() // Main function
{
// Add startup code here.
int c;
//open connection
serial *lcd = fdserial_open(14, 13, 0, 9600); //9600);
pause(1000);
print("\nstarting\n");
print(lcd);
c=fdserial_rxReady(lcd);
print(c);
pause(1000);
c=dprint(lcd, "FFCD\n");
print(c);
//close connection
fdserial_close(lcd);
}
that should clear the screen. Any thoughts? i have tried FFCD\r and FFCD i have tried fdserial_txbyte(lcd,"FF"); etc for each character set.
I feel like i am just missing something stupid. i can send that via the terminal 9600 in 4d labs.
Neil
i can connect via serial connection in the 4d labs utility, and send hex code to set the values.
i am missing something, because i cannot get it to communicate with the fdserial.h like below:
#include "simpletools.h" // Include simple tools
#include "simpletext.h"
#include "fdserial.h"
int main() // Main function
{
// Add startup code here.
int c;
//open connection
serial *lcd = fdserial_open(14, 13, 0, 9600); //9600);
pause(1000);
print("\nstarting\n");
print(lcd);
c=fdserial_rxReady(lcd);
print(c);
pause(1000);
c=dprint(lcd, "FFCD\n");
print(c);
//close connection
fdserial_close(lcd);
}
that should clear the screen. Any thoughts? i have tried FFCD\r and FFCD i have tried fdserial_txbyte(lcd,"FF"); etc for each character set.
I feel like i am just missing something stupid. i can send that via the terminal 9600 in 4d labs.
Neil
Comments
main(){
char c;
serial *lcd = fdserial_open(14, 13, 0, 9600);
pause(10000); //to make the connection
c=fdserial_txChar(lcd, 0xFF);
c=fdserial_txChar(lcd, 0xCD);
c=fdserial_rxReady(lcd);
fdserial_close(lcd);
}
My attempt to use dprint(lcd, [command string]);
did not work... i need to send the hex values as 0xFF then 0xCD (clear screen command)
this is a blue circle:
fdserial_txChar(lcd, 0xFF); //FFC2 0014 0014 0014 435C
fdserial_txChar(lcd, 0xC2);
fdserial_txChar(lcd, 0x00);
fdserial_txChar(lcd, 0x14);
fdserial_txChar(lcd, 0x00);
fdserial_txChar(lcd, 0x14);
fdserial_txChar(lcd, 0x00);
fdserial_txChar(lcd, 0x14);
fdserial_txChar(lcd, 0x43);
fdserial_txChar(lcd, 0x5C);
it is also a pain. anyone have an idea how i can cast my values to hex, so i can send an array to a function? (right now my loop has FF as 255, like is should.) if i could use dprint(), i could do "0%X", or something like that.
thanks
neil