
Bookmaker
USA
Asked
— Edited
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.
DJ, I downloaded the new version and firmware. Tried sending I2Cwrite(0x27,"test") and it blacked out the EZ-B. NEXT?
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...
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
Well, it made the screen go blank. Guess I have some studying to do!!!
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.
No, sadly i have not received it yet
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?
DJ, Did you ever figure out how to get the LCD to work? Mine is still blank.