Jump to content
Sign in to follow this  
ewidance

[Energia Library] LiquidTwi2

Recommended Posts

Hi,

 

II've tested Lincomatic liquidTW2 library ( https://github.com/lincomatic/LiquidTWI2/ ) with an Adafuit i2c LCD backpack (http://www.adafruit.com/product/292 ). with a bidirectional i2c level translator, since backpack and lcd are 5V.

Unfortunately, it does not works out of the box. However, this can be solved easily by inserting a delay BEFORE using the lcd.begin, an an other delay before sending first string.

 

I suspect init time was shorted too much in the library, and because C3200 is much more fast than an arduino, fisrts strings where sent before complete lcd init;

 

In bold in the following source, the two lines added from library example.

/*
 Demonstration sketch for Adafruit i2c/SPI LCD backpack
 using MCP23008 I2C expander
 ( http://www.ladyada.net/products/i2cspilcdbackpack/index.html )

 This sketch prints "Hello World!" to the LCD
 and shows the time.
 
  The circuit:
 * 5V to Arduino 5V pin
 * GND to Arduino GND pin
 * CLK to Analog #5
 * DAT to Analog #4
*/

// include the library code:
#include <Wire.h>
#include <LiquidTWI2.h>

// Connect via i2c, default address #0 (A0-A2 not jumpered)
LiquidTWI2 lcd(0);

void setup() {
  // set the LCD type
  lcd.setMCPType(LTI_TYPE_MCP23008); 
  delay(50);
//  lcd.setMCPType(LTI_TYPE_MCP23017); 
  // set up the LCD's number of rows and columns:
  lcd.begin(20, 4);
  delay(50);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);

  lcd.setBacklight(HIGH);
  delay(500);
  lcd.setBacklight(LOW);
  delay(500);
}

Share this post


Link to post
Share on other sites

 

Hi,

 

II've tested Lincomatic liquidTW2 library ( https://github.com/lincomatic/LiquidTWI2/ ) with an Adafuit i2c LCD backpack (http://www.adafruit.com/product/292 ). with a bidirectional i2c level translator, since backpack and lcd are 5V.

Unfortunately, it does not works out of the box. However, this can be solved easily by inserting a delay BEFORE using the lcd.begin, an an other delay before sending first string.

 

I suspect init time was shorted too much in the library, and because C3200 is much more fast than an arduino, fisrts strings where sent before complete lcd init;

 

In bold in the following source, the two lines added from library example.

@@ewidance Thanks for this!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×