2

I've been trying to get a LCD I bought from deal extreme to work for some time with my ATTiny85 chip. It should be capable. I've tried googling the device but there is no proper documentation, so I figured the best way to get the address is to scan for it. How ever, the code below does not work :( any pointers? Anyone else who has gotten this I2C LCD display to work with Arduino?

As I have no other output then the screen, the thought behind the code is to scan for devices and then when it finds one (the LCD is the only one connected to the bus) should then print the address :)

I only have a serial programmer and attiny85 chips, so I have no way to bring it to a full Arduino UNO or whatever for further debugging.

#include <TinyWireM.h>
#include <LiquidCrystal_I2C.h>

void setup()
{
  TinyWireM.begin();
}


void loop()
{
  byte error, address;

  for(address = 1; address < 127; address++ ) 
  {
    TinyWireM.beginTransmission(address);

    error = TinyWireM.endTransmission();

    if (error == 0) break;

    delay(5000);
  }

  LiquidCrystal_I2C lcd(address, 16, 2);

  lcd.init();
  lcd.backlight(); 
  lcd.clear();

  lcd.setCursor(0, 0);
  lcd.print("Hello World - " + address);
}

I2C LCD: http://www.dx.com/p/iic-i2c-2-5-blue-screen-lcd-display-module-for-arduino-green-black-266170#.U6f_B_l_vIc

migrated from stackoverflow.com Jun 27 '14 at 13:40

This question came from our site for professional and enthusiast programmers.

  • I'd double check your connections then. Is the module getting power? Are you using pull ups? – Ben Jun 23 '14 at 15:00
  • 4
    Why has this question been downvoted? I'm curious, because it seems a legitimate problem the user is having, he has shown research, and although it isn't an arduino chip he's using, he's obviously using the arduino library to compile the hex file. He didn't post the question to Arduino SE, it's been migrated here. I don't mind downvoted questions for crap questions, but when there is at least an honest attempt, why not post constructive comments as to how he could improve it. – Madivad Jun 29 '14 at 9:39
1

I'm not sure on your program, but I bought a LCD display from Deal Extreme. I use the following address to communicate with the display:

LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD address to 0x27

It seems as that is the correct address for the LCD.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.