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

10 thoughts on “LiquidTWI2 v1.1.0 Released”

  1. 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

    1. 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?

  2. 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?

    1. 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.

      1. 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.

  3. Thanks for the excellent library! Remarkably fast. I’m using it for a project where up and down change values and left/right advance menu items. It’s great for incrementing numerical values but makes it too easy to skip over menu items by scrolling through more than one if the button is held down for any length of time. Mind you, this is not a complaint, I’d like to ask though if it’d be easy to constrain left/right buttons to select only one item per button press. The project page is here:

    http://code.google.com/p/scanduino-dslr-based-film-scanner/

    Thanks again for this super slick code.

    1. Cool project you have there.
      The readButtons() method only returns the state of the buttons. If you structure the calling code to look for transitions from up to down, then holding a button down won’t result in a repeat press. The StateChangeDetection example that comes with Arduino is an example of this.

  4. Remember: with so many shows on the air all competing for
    audience attention they’re all looking for a new and different angle.
    The nation got to see how confused and out of touch
    with the American people they really are. According
    to the officials of the association, some tips to be followed by SMBs
    to prevent the attacks are:.

    whoah this blog is wonderful i really like studying your posts.
    Stay up the good work! You realize, a lot of individuals are hunting round for
    this info, you could aid them greatly.

    Also visit my blog … website

Leave a Reply