Welcome to Synthiam!

Program robots using technologies created by industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation, and artificial intelligence easy.

Get Started
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.

#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

Code:


sendI2C(0x27, "Hello World")


and other things like..

Code:


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.
PRO
Synthiam
#33  
Let's hope v13 makes it a bit easier for you by using the script console.

PS, i ordered one. So i'll be able to help you when i get it
#34  
As usual you always go above and beyond. WAY ABOVE AND BEYOND. It is more of a chalange now than a practacality since I have an additonal 20 digital ports to work with I could simply order a serial LCD but like I said it is more of a chalange at this point.
PRO
Synthiam
#35  
LOL, we'll figure it out:)
#36  
Well, I tried a bunch to noavail.
PRO
Synthiam
#37  
Does the screen still go blank with the anything send to the address 0x27?
#38  
DJ,
sendI2C(0x27, "Hello World") Blanks the screen.

I get a lit screen with the curser flashing in position one when I send:
sendI2C(0x27, 0x20, 0x10) # put in 8 bit mode
sendI2C(0x27, 0x20, 0x08) # configure for 2 line display
sendI2C(0x27, 0x01) # clear display
PRO
Synthiam
#39  
Well that's good news!

After those commands, try sending something like

sendI2C(0x27, 0x80, "Hello World")
#40  
No such luck. May be we should wait until you get yours. Don't need taking everyones time up.
#41  
DJ,
I downloaded the new version and firmware. Tried sending I2Cwrite(0x27,"test") and it blacked out the EZ-B. NEXT?
PRO
Synthiam
#42  
You need to i2cStart() first. The i2c command structure has changed to support more devices, including debugging your device.

In order to "talk" to a slave from the master (Ez-b), a Ttart sequences is one of two special sequences defined by the i2c bus. The other sequences is the Stop sequence. So a master must send a Start or a Stop. The master in our case is the EZ-B. The EZ-B plays the roll of a master on the i2c network. Your LCD device would be the slave.

So in your case, you would now need to do this...

Code:


i2cStart()
i2cWrite(0x4E, "test")
i2cStop()


But that's not going to do much. I doubt it would even blank the screen. This is because the first bit (also called the least significant bit or LSB) is set to a 1. What? Ha, let me tell you...

So how I originally implemented the i2c was for simple devices like stepper motor controls, blinkm and one of the lcd's i have. Lately there have been people using different i2c devices that require special care. That means I had to dramatically change the i2c command structure. We have an ez-robot member, for example that is building a flying drone and needs to talk to a specific g sensor.

What's this about bits? It's an i2c thing... Here's how it works. So the address of i2c devices or functions are really 7 bit, and the 8th bit is used for the direction (kinda). So let's say your LCD address is 0x27. Well that's 00100111 in binary IF it was an 8 bit number. But because the address is 7 bit and we use the 8th bit to determine the communication direction (Read/Write), we need to shift the bits over by 1.

So you always need your first bit to be a 0 when writing. That means your address is actually 0x4E and not 0x27. Because you have to shift the bits over of 0x27. When you shift bits from left to the right, you multiple the number by 2.

0x27 = 0010 0111
0x4E = 0100 1110

See how the last bit is now a 0 with the 0x4E? That means "write to the device".

Read more here www.robot-electronics.co.uk/acatalog/I2C_Tutorial.html
#43  
Well, it made the screen go blank. Guess I have some studying to do!!!
#44  
DJ,
Did you receive your LCD yet? If so any progress on getting something to print? Buster wants to know. Gosh, it has only been a week. It seemed like alot longer. Anyway, after our Etiquette lesson I am feeling realy stupid. Please disregard my impatients. I will just wait.
PRO
Synthiam
#45  
No, sadly i have not received it yet
#46  
I was tinkering with the blinkM I just got and wanted to try things out. I noticed when making a script that the 'auto complete' doesnt have "sendI2C". Theres the I2CWrite and SendSerial. There are a few references to SendI2C as examples under the script help on the right side. Im new to this so am I missing something?
#47  
DJ,
Did you ever figure out how to get the LCD to work? Mine is still blank.