Asked — Edited

LCD Display

DJ, I am out of Digital Ports and I want to use a LCD Display. Can I use a 12C port and if so do I need to purchase a special interface and how would I input the text since the only control available under 12C is blinkin and nothing that I can see in Script? I await your input.


ARC Pro

Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

PRO
Synthiam
#17  

I also just read that the default address could be 0x4C ... Geez this LCD is not documented well

so maybe this will work..


sendI2C(0x4C, "Hello World")

PS.. I'd cycle the LCD power before trying different commands. Each command might get to the LCD but do something that makes the next command not work.

#18  

Thanks a bunch DJ, I am at work now but I will try it when I get home. It is definitely i2C. I did try the sendI2C(0x27, "Hello World") but all that happened was the screen went dead. Thanks for all your time!

PRO
Synthiam
#19  

Wait!!! It responded with 0x27? That might be it!! See if it goes dead with 0x4C also...

Does it normally go dead? Or only that time?

Chinese stuff like this is never documented well

#20  

Actually that is the one and only responce I have gotten.

PRO
Synthiam
#21  

Okay then we're on the right track for address ID i think

#22  

Hello, I just got home and tried everything you mentioned. The only one that did anything was the sendI2C(0x27, "Hello world") which blanked the screen.

PRO
Synthiam
#23  

Okay, that's a start. Now we need to find out how to send commands.

How about


SendI2C(0x27, 0x80, "Hello World")

PRO
Synthiam
#24  

For reference:


// commands (these are sent either alone or as an identifier
#define LCD_CLEARDISPLAY 0x01
#define LCD_RETURNHOME 0x02
#define LCD_ENTRYMODESET 0x04
#define LCD_DISPLAYCONTROL 0x08
#define LCD_CURSORSHIFT 0x10
#define LCD_FUNCTIONSET 0x20
#define LCD_SETCGRAMADDR 0x40
#define LCD_SETDDRAMADDR 0x80

// flags for display entry mode (LCD_ENTRYMODESET)
#define LCD_ENTRYRIGHT 0x00
#define LCD_ENTRYLEFT 0x02
#define LCD_ENTRYSHIFTINCREMENT 0x01
#define LCD_ENTRYSHIFTDECREMENT 0x00

// flags for display on/off control (LCD_DISPLAYCONTROL)
#define LCD_DISPLAYON 0x04
#define LCD_DISPLAYOFF 0x00
#define LCD_CURSORON 0x02
#define LCD_CURSOROFF 0x00
#define LCD_BLINKON 0x01
#define LCD_BLINKOFF 0x00

// flags for display/cursor shift (LCD_CURSORSHIFT)
#define LCD_DISPLAYMOVE 0x08
#define LCD_CURSORMOVE 0x00
#define LCD_MOVERIGHT 0x04
#define LCD_MOVELEFT 0x00

// flags for function set (LCD_FUNCTIONSET)
#define LCD_8BITMODE 0x10
#define LCD_4BITMODE 0x00
#define LCD_2LINE 0x08
#define LCD_1LINE 0x00
#define LCD_5x10DOTS 0x04
#define LCD_5x8DOTS 0x00

// flags for backlight control (LCD_DISPLAYCONTROL)
#define LCD_BACKLIGHT 0x08
#define LCD_NOBACKLIGHT 0x00