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

ARC Pro is your gateway to a community of like-minded robot enthusiasts and professionals, all united by a passion for advanced robot programming.

PRO
Synthiam
#25  

So looks like you can do this for initialization....


sendI2C(0x27, 0x20, 0x10) # put in 8 bit mode
sendI2C(0x27, 0x20, 0x08) # configure for 2 line display
sendI2C(0x27, 0x01) # clear display
sendI2C(0x27, 0x02) # return home (not sure if this is needed)

I'm not sure, but looks like you need to put it in some Enable mode to begin writing after you initialize


sendI2C(0x27, 0x10) # enable high
sendI2C(0x27, "Hello World")
sendI2C(0x27, 0xEF) # enable low

#26  

Ah, ha I will give it a try as soon as I get home. Are you sure that last line of code (0xEF) is correct? All the others are numbers???

PRO
Synthiam
#27  

All numbers that have a 0x in front of them are called Hexidecimal

0xEF is a number. It is hexidecimal. It is another way to count, but it is base 16. Normal counting is Base 10 and it is called Decimal (for 10:))

Hexidecimal counts like this: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 2A 2B 2C 2D 2E 2F ....

So the least significant digit (the digit on the right) increases from 0 to F before the next digit increases. You can count to 255 with Hex by having only two digits. Decimal 255 is FF Hex

Hex 0xEF is 239 in decimal

You could write that same peice of code without the 0x and specify decimal instead...


sendI2C(39, 239)

Look at this link: http://www.cdrummond.qc.ca/cegep/informat/Professeurs/Alain/files/ascii.htm

#28  

Thanks for the ASCII lesson. I tried the code above and the screen blinked. Without the last line of code the screen went blank. What now?

PRO
Synthiam
#29  

Keep trying:)

Ill post something soon as I can think of anything else... hmm

#30  

Hello DJ, Love V13. Does the read I2C help any to find out how to print with my LCD?

PRO
Synthiam
#31  

Having no datasheet on that lcd isn't making this easy. Have you tried anything since then? Just keep poking at it. We know that the screen clears when we send any data to 0x27 .. So we have to assume the LCD address is 0x27.

Try sending more data to 0x27 and see what you get. Try different things like


sendI2C(0x27, "Hello World")

and other things like..


sendI2C(0x27, 0x01, "hello world")

and try incrementing 0x01 by 1 .. try 0x02, 0x03, 0x04... etc

#32  

Thanks DJ, I will give that a try.