Hello all,
I have been using arduino for awhile, but this is my first post in the forums. I have built a project that is working fine using the 6 data pins that I declare in my code:
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
but my senior partners and I in my class would like to imply more use of the Digital Pin outs especially the SPI pin outs, so I have decided to try the I2C route. Now I have connected Pin analog 4 (SDA ) and analog 5 (SDL) to the resepective Two wire interface for the board on the back of the 20 x 4 LCD as well as VCC and GND.
All the test code provided online doesn't work, I have arduino 1.0 and arduino 1.0.1 and it is kicking my @$$ on trying to get some readout on the LCD at all...I can get it to load using this code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27 20,4); //set the LCD address to 0x27
void setup()
{
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("b2cqshop");
lcd.setCursor(0, 1);
lcd.print("Voltage: ");
lcd.setCursor(13, 1);
lcd.print("V");
}
void loop()
{
int val;
float temp;
val=analogRead(0);
temp=val/4.092;
val=(int)temp;//
lcd.setCursor(9, 1);
lcd.print(0x30+val/100);
lcd.print(0x30+(val%100)/10);
lcd.print('.');
lcd.print(0x30+val%10);
delay(100);
}
but the LCD just doesn't do anything......I know all about the ACK bit for the 7 / 8 bit transfer using I2C and the wire library needs to be included which it is.....
IS THERE ANYONE OUT THERE THAT HAS DONE a simple Arduino Uno to I2C LCD that could step me through some simple basics to get any readout on the 20 x 4 LCD...direct me to a proper library ...something....
the 4 wire harness I have is fine as well (Ohmed it out..) ...Pot for contrast is good too....
Please Please help
Aaron
Moderator edit: Code tags added.