i2c / SPI character LCD backpack issue

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
bcook65
 
Posts: 109
Joined: Sat Apr 03, 2010 1:25 pm

i2c / SPI character LCD backpack issue

Post by bcook65 »

Hello, recently purchased a i2c / SPI character LCD backpack and an 16x2 LCD and am having some problems getting it to work.
I downloaded the new liquidcrystal library etc.
I load the i2c hello world sketch and library

Code: Select all

#include <LiquidCrystal.h>
#include <MCP23008.h>

/*
 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 #4
 * DAT to Analog #5
*/

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

// Connect via i2c, default address #0 (A0-A2 not jumpered)
LiquidCrystal 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);
}
But get errors when i try to upload to the arduino..

HelloWorld_i2c:23: error: no matching function for call to 'LiquidCrystal::LiquidCrystal(int)'
X:\Arduino\arduino-0021\libraries\LiquidCrystalold/LiquidCrystal.h:56: note: candidates are: LiquidCrystal::LiquidCrystal(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)
X:\Arduino\arduino-0021\libraries\LiquidCrystalold/LiquidCrystal.h:54: note: LiquidCrystal::LiquidCrystal(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)
X:\Arduino\arduino-0021\libraries\LiquidCrystalold/LiquidCrystal.h:52: note: LiquidCrystal::LiquidCrystal(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)
X:\Arduino\arduino-0021\libraries\LiquidCrystalold/LiquidCrystal.h:49: note: LiquidCrystal::LiquidCrystal(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)
X:\Arduino\arduino-0021\libraries\LiquidCrystalold/LiquidCrystal.h:45: note: LiquidCrystal::LiquidCrystal(const LiquidCrystal&)

Did I do something wrong or miss a step? I followed the instructions on the backpack/lcd page and my wiring looks correct.

thanks

Bill

User avatar
zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: i2c / SPI character LCD backpack issue

Post by zener »

Did you download and install the modified library from GitHub?

User avatar
bcook65
 
Posts: 109
Joined: Sat Apr 03, 2010 1:25 pm

Re: i2c / SPI character LCD backpack issue

Post by bcook65 »

Zener wrote:Did you download and install the modified library from GitHub?
Yeah.. followed the link given in the directions

User avatar
adafruit_support_bill
 
Posts: 88092
Joined: Sat Feb 07, 2009 10:11 am

Re: i2c / SPI character LCD backpack issue

Post by adafruit_support_bill »

Are you sure you have the library loaded in the right location?

I downloaded it and tried to compile the file you posted. It complained of duplicate definitions of MCP23008. I removed the second #include and it compiled fine.

User avatar
bcook65
 
Posts: 109
Joined: Sat Apr 03, 2010 1:25 pm

Re: i2c / SPI character LCD backpack issue

Post by bcook65 »

arduwino wrote:Are you sure you have the library loaded in the right location?

I downloaded it and tried to compile the file you posted. It complained of duplicate definitions of MCP23008. I removed the second #include and it compiled fine.
Hehehe.. I thought I had it loaded in the only place there was for it.. I can go back and delete it and try again

User avatar
bcook65
 
Posts: 109
Joined: Sat Apr 03, 2010 1:25 pm

Re: i2c / SPI character LCD backpack issue

Post by bcook65 »

ok.. I found the problem.. The example sketch automatically loads the library.. and I was loading the sketch and then the library

thanks

User avatar
bcook65
 
Posts: 109
Joined: Sat Apr 03, 2010 1:25 pm

Re: i2c / SPI character LCD backpack issue

Post by bcook65 »

anyone know where i can buy a 9 or 12 digit number key pad for project use??

User avatar
adafruit_support_bill
 
Posts: 88092
Joined: Sat Feb 07, 2009 10:11 am

Re: i2c / SPI character LCD backpack issue

Post by adafruit_support_bill »

To make life easy, you probably want a matrix keypad compatible with the Arduino keypad library: http://www.arduino.cc/playground/Main/KeypadTutorial
Devantech and Velleman both have 12-key matrix pads. Here's a source for the devantech: http://www.acroname.com/robotics/parts/ ... EYPAD.html

User avatar
bcook65
 
Posts: 109
Joined: Sat Apr 03, 2010 1:25 pm

Re: i2c / SPI character LCD backpack issue

Post by bcook65 »

arduwino wrote:To make life easy, you probably want a matrix keypad compatible with the Arduino keypad library: http://www.arduino.cc/playground/Main/KeypadTutorial
Devantech and Velleman both have 12-key matrix pads. Here's a source for the devantech: http://www.acroname.com/robotics/parts/ ... EYPAD.html

thanks. I went ahead and ordered one

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”