So here's the deal. I am building a slider and was hoping to get one piece done at a time and kind of try to combine them as a whole. I've got my LCD screen in hand so I want to understand it, and how to use it/customize it.
I am using a SainSmart IIC Serial LCD1602 w/ the given Library.
http://www.sainsmart.com/new-sainsmart-iic-i2c-twi-1602-serial-lcd-module-display-for-arduino-uno-mega-r3.html
I am using a sketch from Amazon because reviewers claimed how crap the given on is. Multiple users say they have had success, though I'm having errors.
/*
** Example Arduino sketch for SainSmart I2C LCD2004 adapter for HD44780 LCD screens
** Readily found on eBay or [...]
** The LCD2004 module appears to be identical to one marketed by YwRobot
**
** Edward Comer
** LICENSE: GNU General Public License, version 3 (GPL-3.0)
**
** sain_lcd_2.ino
** Simplified and modified by Andrew Scott for Arudino 1.0.1, Arudino Uno R3.
** NOTE: I2C pins are A4 SDA, A5 SCL
** Don't forget to use the new LiquidCrystal Library from [...]
*/
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#define I2C_ADDR 0x3F // Define I2C Address where the SainSmart LCD is
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
void setup()
{
lcd.begin (16, 2);
// Switch on the backlight
lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
lcd.setBacklight(HIGH);
// Position cursor and write some text
lcd.home (); // go to the first line, first character
lcd.print("SainSmart I2C tester");
lcd.setCursor ( 0, 1 ); // go to the 2nd line
lcd.print("It's Working!");
}
void loop() {
}
The error I am getting is:
"no matching function for call to 'LiquidCrystal_12C::LiquidCrystal_12C(int, int, int, int, int, int, int, int)'
The error text reads:
In file included from sketch_jan01a.ino:1:
C:\Program Files (x86)\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:81: error: conflicting return type specified for 'virtual void LiquidCrystal_I2C::write(uint8_t)'
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'
sketch_jan01a:31: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)'
C:\Program Files (x86)\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:57: note: candidates are: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t)
C:\Program Files (x86)\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:55: note: LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&)
sketch_jan01a.ino: In function 'void setup()':
sketch_jan01a:38: error: 'class LiquidCrystal_I2C' has no member named 'setBacklightPin'
sketch_jan01a:38: error: 'POSITIVE' was not declared in this scope
I apologize if this is out of line somehow, but I have no idea where to begin....and this is just the LCD screen.