Hello!
Curious if anyone has tried this library with an Arduino Due?
I can get the Adafruit RGB Backlight LCD Backpack (16x2) to light up and display all pixels on for the top row, and no pixels on the bottom.
Any ideas?
-t
LiquidTWI: High-performance LCD library for I2C Backpack Module
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- viciousfish
- Posts: 3
- Joined: Fri Dec 12, 2014 3:07 am
-
- Posts: 2
- Joined: Sun Sep 29, 2013 5:56 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack
Hi newbies (like myself),
You may want to get together all the information on how to "connect" this backplate to Arduino boards...
It got me crazy for a few days since I noticed about not being used the same pins for different boards, so;
Please find below the "updated" HelloWorld_i2c example.
Bye now... :)
/*
Demonstration sketch for Adafruit i2c/SPI LCD backpack
using MCP23008 I2C expander
( http://www.ladyada.net/products/i2cspil ... 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
UNO:
* DAT to A4
* CLK to A5
MEGA:
* DAT to 20
* CLK to 21
LEONARDO:
* DAT to 2
* CLK to 3
*/
// include the library code:
#include <Wire.h>
#include <LiquidTWI.h>
// Connect via i2c, default address #0 ( Not A0 nor A1 nor A2 jumpered)
LiquidTWI lcd(0);
void setup() {
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// 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);
}
You may want to get together all the information on how to "connect" this backplate to Arduino boards...
It got me crazy for a few days since I noticed about not being used the same pins for different boards, so;
Please find below the "updated" HelloWorld_i2c example.
Bye now... :)
/*
Demonstration sketch for Adafruit i2c/SPI LCD backpack
using MCP23008 I2C expander
( http://www.ladyada.net/products/i2cspil ... 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
UNO:
* DAT to A4
* CLK to A5
MEGA:
* DAT to 20
* CLK to 21
LEONARDO:
* DAT to 2
* CLK to 3
*/
// include the library code:
#include <Wire.h>
#include <LiquidTWI.h>
// Connect via i2c, default address #0 ( Not A0 nor A1 nor A2 jumpered)
LiquidTWI lcd(0);
void setup() {
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// 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);
}
- davisbr9
- Posts: 4
- Joined: Fri Aug 01, 2014 1:48 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack
Are we locked into using A4 and A5 for this library?
- adafruit_support_bill
- Posts: 88151
- Joined: Sat Feb 07, 2009 10:11 am
Re: LiquidTWI: High-performance LCD library for I2C Backpack
Yes. I2C communication requires the SDA and SCL pins of the I2C bus. These are A4 and A5 on an Arduino Uno.
-
- Posts: 2
- Joined: Sun Sep 29, 2013 5:56 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack
Hi muldereric,
Steps to go through:
Check Mega pins used to connect the backplate.
Hope it helps!!!.
Let us know about your results
Steps to go through:
Check Mega pins used to connect the backplate.
- As mentioned befrore, for MEGA they it shold be connected this way: DAT to 20 and CLK to 21.
Hope it helps!!!.
Let us know about your results
- muldereric
- Posts: 4
- Joined: Thu Jan 15, 2015 4:23 am
Re: LiquidTWI: High-performance LCD library for I2C Backpack
Though having enough programming experience, the Arduino was new to me. Because the display worked fine the last time I checked (year or so ago) I assumed it would still be and therefore doubted about either the i2c controls or the Adafruit i2c lcd backpack.EA3BIL wrote:Hi muldereric,
Steps to go through:
Check Mega pins used to connect the backplate.Check by using another LCD (if availble...).
- As mentioned befrore, for MEGA they it shold be connected this way: DAT to 20 and CLK to 21.
Hope it helps!!!.
Let us know about your results
I experimented with a Raspberry Pi some months back and remembered having a Adafruit i2c driven 8x8 led matrix (gotta love Adafruit for their nice and extensive list of products) that i bought for fun. Dug up the small module, hooked it up to the Arduino, cloned the repo and fired up the included sample project......but......it still didn't work. Though hooking up power first and then the scl/sda lines, the matrix didn't respond. A simple reset of the controller did the job though.
Took the old lcd module and put it on the workbench. With the proper tools it took under a minute to figure out the backlight led of the module is fried :(
I wanted to use the lcd module because I had it laying around, but now thinking of buying me a nice tft touchscreen.
Off topic: Any suggestions regarding Arduinocompatible tft touchscreens for a good price?
- adafruit_support_bill
- Posts: 88151
- Joined: Sat Feb 07, 2009 10:11 am
Re: LiquidTWI: High-performance LCD library for I2C Backpack
We have both resistive and capacitive touch-shields:
https://www.adafruit.com/products/1651
https://www.adafruit.com/products/1947
As well as some in breakout form
https://www.adafruit.com/search?q=tft+t ... eakout&b=1
https://www.adafruit.com/products/1651
https://www.adafruit.com/products/1947
As well as some in breakout form
https://www.adafruit.com/search?q=tft+t ... eakout&b=1
- DR49
- Posts: 1
- Joined: Fri Mar 11, 2016 11:18 am
Re: LiquidTWI: High-performance LCD library for I2C Backpack
Hi
I'm looking for a library similar to yours, to control an LCD I2C backpack 16x2, but compatible with arduino M0pro which provide I2C bus over dedicated pins (SCL and SDA).
Can you help me please ?
Many thanks
Daniel
I'm looking for a library similar to yours, to control an LCD I2C backpack 16x2, but compatible with arduino M0pro which provide I2C bus over dedicated pins (SCL and SDA).
Can you help me please ?
Many thanks
Daniel
- squiggyreck
- Posts: 1
- Joined: Thu Aug 18, 2011 10:29 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack
Is there a way to use Port 0 when using the LiquidTWI library?
I want to put an LED on Port 0 (Actual Pin 10 of MCP23008).
The LED will go High or Low.
I want to put an LED on Port 0 (Actual Pin 10 of MCP23008).
The LED will go High or Low.
- Incalculable
- Posts: 8
- Joined: Thu Apr 21, 2016 5:21 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack
Hi @all,
i tried to use the LiquidTWI (and LiquidTWI2) library with the adafruit lcd and i2c backpack on a project with an arduino MKR1000, since i wish for a faster lcd control. But it worked only twice (by luck). With the adafruit_liquidcrystal library all works fine. i also tried on a feather M0, same behaviour. It seems as if the display doesn`t start up, once running it works fine.
I looked into the begin() function of the library and tried some changes but had no luck.
Has anybody got this library running with an ATMEL SAMD based chipset, as in an arduino mkr1000 or adafruit feather, and can me tell about what changes are necessary in the library or if theres a working version out there?
Thanks!
Rgds Vinc
i tried to use the LiquidTWI (and LiquidTWI2) library with the adafruit lcd and i2c backpack on a project with an arduino MKR1000, since i wish for a faster lcd control. But it worked only twice (by luck). With the adafruit_liquidcrystal library all works fine. i also tried on a feather M0, same behaviour. It seems as if the display doesn`t start up, once running it works fine.
I looked into the begin() function of the library and tried some changes but had no luck.
Has anybody got this library running with an ATMEL SAMD based chipset, as in an arduino mkr1000 or adafruit feather, and can me tell about what changes are necessary in the library or if theres a working version out there?
Thanks!
Rgds Vinc
- Prof_Porpoise
- Posts: 18
- Joined: Fri Mar 18, 2016 4:18 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack
Hey,
Im kinda a noob. I got this Code online and I do not know how to make it work with the adafruit i2c backpack. Someone told m to come here. What do I do the code to make it work?
Im kinda a noob. I got this Code online and I do not know how to make it work with the adafruit i2c backpack. Someone told m to come here. What do I do the code to make it work?
Code: Select all
//LCD config
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3f,20,4);
#include <Servo.h>
#include <Keypad.h>
//Variables
int mot_min = 90; //min servo angle (set yours)
int mot_max = 180; //Max servo angle (set yours)
int character = 0;
int activated =0;
char Str[16] = {' ', ' ', ' ', ' ', ' ', ' ', '-', '*', '*', '*', ' ', ' ', ' ', ' ', ' ', ' '};
//Pins
Servo myservo;
int buzzer=11; //pin for the buzzer beep
int external = 12; //pin to inside open
int internal = 13; //pin to inside close
//Keypad config
const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
//define the cymbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
{'1','4','7','*'},
{'2','5','8','0'},
{'3','6','9','#'},
{'A','B','C','D'}
};
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {9, 8, 7, 6}; //connect to the column pinouts of the keypad
//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
void setup(){
myservo.attach(10); //attach the servo to pin D10
pinMode(buzzer,OUTPUT);
pinMode(external,INPUT);
pinMode(internal,INPUT);
//Init the screen and print the first text
lcd.init();
lcd.backlight();
lcd.clear();
lcd.print(" PASSWORD");
lcd.setCursor(0,1);
lcd.print(" -*** ");
//put the servo in the close position first
myservo.write(mot_min);
}
void loop(){
///////////////EMERGENCY OPEN/CLOSE/////////
if (digitalRead(external))
{
myservo.write(mot_max);
lcd.clear();
lcd.setCursor(2,0);
lcd.print("INSIDE OPEN");
activated = 2;
analogWrite(buzzer,240);
delay(250);
analogWrite(buzzer,200);
delay(250);
analogWrite(buzzer,180);
delay(250);
analogWrite(buzzer,250);
delay(250);
analogWrite(buzzer,LOW);
lcd.clear();
lcd.setCursor(4,0);
lcd.print("WELLCOME");
lcd.setCursor(2,1);
lcd.print("MakerSpace");
lcd.clear();
lcd.setCursor(3,0);
lcd.print("DOOR OPEN");
lcd.setCursor(2,1);
lcd.print("MakerSpace");
delay(500);
}
if (digitalRead(internal))
{
myservo.write(mot_min);
activated = 0;
character=0;
Str[6]= '-';
Str[7]= '*';
Str[8]= '*';
Str[9]= '*';
Str[10]= ' ';
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" PASSWORD");
lcd.setCursor(0,1);
lcd.print(Str);
}
///////////////KEYPAD OPEN/CLOSE////////////
char customKey = customKeypad.getKey(); //this function reads the presed key
if (customKey){
if (character ==0)
{
Serial.println(customKey);
Str[6]= customKey;
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" PASSWORD");
lcd.setCursor(0,1);
lcd.print(Str);
}
if (character ==1)
{
Serial.println(customKey);
Str[7]= customKey;
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" PASSWORD");
lcd.setCursor(0,1);
lcd.print(Str);
}
if (character ==2)
{
Serial.println(customKey);
Str[8]= customKey;
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" PASSWORD");
lcd.setCursor(0,1);
lcd.print(Str);
}
if (character ==3)
{
Serial.println(customKey);
Str[9]= customKey;
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" PASSWORD");
lcd.setCursor(0,1);
lcd.print(Str);
}
if (character ==4)
{
Serial.println(customKey);
Str[10]= customKey;
activated=1;
}
character=character+1;
}
if (activated == 1)
{
/*Change your password below!!!
Change each of Str[6], Str[7], Str[8], Str[9]*/
if(Str[10]='A' && character==5 && Str[6]=='3' && Str[7]=='0' && Str[8]=='0' && Str[9]=='7' )
{
myservo.write(mot_max);
lcd.clear();
lcd.setCursor(4,0);
lcd.print("ACCEPTED");
activated = 2;
analogWrite(buzzer,240);
delay(250);
analogWrite(buzzer,200);
delay(250);
analogWrite(buzzer,180);
delay(250);
analogWrite(buzzer,250);
delay(250);
analogWrite(buzzer,LOW);
delay(1000);
lcd.clear();
lcd.setCursor(4,0);
lcd.print("WELLCOME");
delay(500);
lcd.setCursor(2,1);
lcd.print("MakerSpace");
delay(1000);
lcd.clear();
lcd.setCursor(3,0);
lcd.print("DOOR OPEN");
lcd.setCursor(2,1);
lcd.print("MakerSpace");
}
else
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print("PASSWORD ERROR");
lcd.setCursor(3,1);
lcd.print("TRY AGAIN");
analogWrite(buzzer,150);
delay(3000);
analogWrite(buzzer,LOW);
character=0;
Str[6]= '-';
Str[7]= '*';
Str[8]= '*';
Str[9]= '*';
Str[10]= ' ';
activated = 0;
lcd.clear();
lcd.setCursor(4,0);
lcd.print("PASSWORD");
lcd.setCursor(0,1);
lcd.print(Str);
}
}
if (activated == 2)
{
if(customKey == 'B' )
{
myservo.write(mot_min);
activated = 0;
character=0;
Str[6]= '-';
Str[7]= '*';
Str[8]= '*';
Str[9]= '*';
Str[10]= ' ';
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" PASSWORD");
lcd.setCursor(0,1);
lcd.print(Str);
}
}
}
- adafruit_support_bill
- Posts: 88151
- Joined: Sat Feb 07, 2009 10:11 am
Re: LiquidTWI: High-performance LCD library for I2C Backpack
What happens when you try to run the code?
- Prof_Porpoise
- Posts: 18
- Joined: Fri Mar 18, 2016 4:18 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack
It uploads but nothing appears on the LCD. I was told the library does not work with the adafuit backpack
- adafruit_support_bill
- Posts: 88151
- Joined: Sat Feb 07, 2009 10:11 am
Re: LiquidTWI: High-performance LCD library for I2C Backpack
That may be true. I am not familiar with that library.I was told the library does not work with the adafuit backpack
The library we support for that product is this one: https://github.com/adafruit/Adafruit_LiquidCrystal
Instructions for use can be found in the guide: https://learn.adafruit.com/i2c-spi-lcd- ... k/overview
- HFeindel
- Posts: 2
- Joined: Wed May 31, 2017 4:09 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack
Adafruit, you've recommended this library for use with your LCD Backpack, however, the Dropbox link provided by FalconFour is no longer valid.
Is there another source from which the file may be downloaded?
Is there another source from which the file may be downloaded?
Please be positive and constructive with your questions and comments.