Btw, I think Iāl complaining too much those days (or asking too much questions, I donāt know)ā¦ yet Iām in vacation.
Anyway, I wanted to try and prepared all the code but I still miss a socket number for software I2C. The constructor does indeed permit the use of different pins, but it still need a socket number. And thatās where Iām lost : what is the socket number that is connected to the āArduino headersā ?
Also, while waiting for an answer, Iāve checked that it was good with hardware i2c, using Extender on socket #2.
Wellā¦ itās almost good for a first try. The same code does not behave the same on the Cerbuino and on the Panda. See attached picture, on which you can see two LCDs, one connected to the Panda on the right and the other on the Cerbuino on the left.
The text that should be displayed is obviously wrong on the Cerbuino It should of course read āCerbuino LCD I2C #1ā.
Now, what is weird here is that other functions of the LCD are working good, which means that there are no lost bytes. For example, to turn the backlight on, I send an array with 2 bytes in it : 0 and 19. And the backlight indeed turns on (and off with [0,20]).
The same erroneous string is also displayed if I set the cursor some columns away : the position of the cursor is good, but the string is still missing its 2 first chars !
After some research, it looks like the Cerbuino doesnāt like more that one transaction at a time.
The following code does not work :
I2CDevice.I2CTransaction[] xActions = new I2CDevice.I2CTransaction[2];
xActions[0] = I2CDevice.CreateWriteTransaction(new byte[4] { 0, 3, y, x });
xActions[1] = I2CDevice.CreateWriteTransaction(System.Text.Encoding.UTF8.GetBytes((byte)0 + Text));
I2C.Execute(xActions, 1000);
but this one does work :
I2CDevice.I2CTransaction[] xActions = new I2CDevice.I2CTransaction[1];
xActions[0] = I2CDevice.CreateWriteTransaction(new byte[4] { 0, 3, y, x });
I2C.Execute(xActions, 1000);
Thread.Sleep(5);
xActions[0] = I2CDevice.CreateWriteTransaction(System.Text.Encoding.UTF8.GetBytes((byte)0 + Text));
I2C.Execute(xActions, 1000);
Now I have the correct display āCerbuino LCD I2C #1ā.
I donāt know if it is important or if it matters or not, but itās a (major) difference between USBizi and Cerbuino (I didnāt check on Hydra).