LiquidTWI2 v1.1.0 Released
For the Adafruit RGB LCD Shield (MCP23017), I changed the GPIO writing from 16-bit to 8-bits. This increased the library size by 14 bytes, but it’s well worth it, because writing a 47-character string has sped up from 99ms to 76ms on my Arduino Duemilanove – that’s about a 25% increase! This is vs Adafruit’s RGB LCD library, which is 1.4K bigger, and takes 322ms.
Download: LiquidTWI2
Related Post: LiquidTWI2 – A Lean, High Performance I2C LCD Library for Arduino
There are 6 Comments to "LiquidTWI2 v1.1.0 Released"
Hey, I have made a couple of additions to this library to use the interrupt functions to read an encoder. Thanks for the good work on the library.
I am about to start exploring the changes you have made to your fork of Marlin firmware to implement this library… any plans to update to the more recent version of marlin with the updates and the split between screen implementation and menu implementation? Just don’t want to do too much if its all about to change again!
Cheers
Tony
I am not sure why you are adding encoder support to LiquidTWI2, since it is an LCD library, it would probably be better to keep it in a separate library. Do you have your code posted somewhere?
My last upstream merge with Marlin was on 2012.10.12. Were there major changes since then?
Copy of the code is here:
http://www.think3dprint3d.com/home/files/LiquidTWI2_t3p3.zip
I still need to get up to speed with github.
The idea of adding interrupt support was the same idea as having the readButtons() function: to support input that closely associated with the LCD and is using I2C. I could put the code to read and write registers on the MCP23017 in another library but it seamed better with the other code that already talks the port expander.
Recently (about a week ago) the ultralcd part of Marlin was updated quite a bit – splitting out the hardware from the menu interface. Reading the Marlin github it makes sense – allowing different hardware implementations with the same menu code but I have not delved into it in detail.
Also can I ask why you reading only one of the 5 buttons on the Adafruit LCD shield in your fork of Marlin?
Ah, OK, I didn’t realize that your encoder was attached to the MCP23017 and accessed via I2C. The Panucatt controller that I have (and I believe the Ultipanel, as well) connects the encoder directly to the MCU pins. It makes sense to extend LiquidTWI2 to handle your encoder, since it’s under control of the MCP23017.
Since the Marlin changes are so recent, it might be a good idea to wait a little while for the dust to settle before modifying it, but if you want to send me one of your controllers I can take a stab at doing the port.
I am only reading one button because the existing code only handles one button, and I didn’t want to spend the time hacking the code to add the other buttons, since I use an encoder.
BTW, I merged the PANELOLU2 code into LiquidTWI2, and bumped the version to 1.1.1 on github
Thanks for merging in the changes, and thanks also for the offer of porting to the new Marlin. I have your fork with LiquidTWI2 and intend to play around with it to get the I2C encoder to work – its a good chance for me to understand more about how Marlin, especially the ultralcd parts work in detail. I will certainly send you a controller once i have some ready to send out.