Hello guys,
I have beeen searching for a long time but didn't find any solution to my problem.
So I'm writing here with the hope to find some help, or at least new ways to investigate.
I have a LCD wich I think is a I2C LCD DISPLAY VERSION 3. I has for sure an i2c adapter.
I can use it along with F Malpartida LiquidCrystal library (the only one which works well for me) and a Duemilanove Arduino using i2c.
I would like to use it with an ATTiny85.
To do that I have modified the I2CIO.cpp file of the library to add some #ifdef AVR_ATtiny85 to use TinyWireM in spite of Wire, and to change "read" to "receive" and "write" to "send".
Sketch compiles well, executes well for sentences relates to leds, but does nothing on the LCD. Even the LCD blink sequence does nothing.
Here's the small test sketche :
#include "LiquidCrystal_I2C.h"
#include <TinyWireM.h>
#define LED1_PIN 4 // ATtiny Pin 3
#define LED2_PIN 1 // ATtiny Pin 6
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Addr, En, Rw, Rs, d4, d5, d6, d7, backlighpin, polarity
void setup()
{
pinMode(LED1_PIN,OUTPUT);
pinMode(LED2_PIN,OUTPUT);
Blink(LED1_PIN,5);
lcd.begin(16,2); // initialize the lcd
// ------- Quick 3 blinks of backlight -------------
for(int i = 0; i< 3; i++)
{
lcd.backlight();
delay(250);
lcd.noBacklight();
delay(250);
}
lcd.backlight(); // finish with backlight on
Blink(LED2_PIN,2);
lcd.setCursor(3,0);
//lcd.home (); // go home
Blink(LED2_PIN,3);
lcd.print("Salut Noury");
Blink(LED2_PIN,4);
}
void loop()
{
}
void Blink(byte led, byte times){ // poor man's GUI
for (byte i=0; i< times; i++){
digitalWrite(led,HIGH);
delay (400);
digitalWrite(led,LOW);
delay (175);
}
delay(1000);
}
Led1 and led2 blink as expected, but not the LCD. And of course there's no display.
All works well with a "real" Arduino and changing the bord to Duemilanove in the ide
I must add that I'm using pull-ups resistors on the CLK and SDA pins.
Really hope to find some help here.
Regards
nb