Loading...
  Show Posts
Pages: [1]
1  Using Arduino / LEDs and Multiplexing / Re: [SOLVED] SainSmart / YwRobot I2C LCD works well on: January 26, 2013, 05:11:34 pm
Hey guys,

its been hours today.................................

Following:
I have a DFRobot 2004, got ist about 5 days ago.
After searching half an hour for a working lib and reading to try address 0x20, i got it working, until today.
When i first used the wrong lib, i just saw two lines fully illuminated.
With the right library and code, i got it working.

i used exactly this code:

Code:
//Please download the Arduino library!
//The link:http://www.dfrobot.com/image/data/DFR0154/LiquidCrystal_I2Cv1-1.rar
//DFRobot.com
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
 
#if defined(ARDUINO) && ARDUINO >= 100
#define printByte(args)  write(args);
#else
#define printByte(args)  print(args,BYTE);
#endif
 
uint8_t bell[8]  = {0x4,0xe,0xe,0xe,0x1f,0x0,0x4};
uint8_t note[8]  = {0x2,0x3,0x2,0xe,0x1e,0xc,0x0};
uint8_t clock[8] = {0x0,0xe,0x15,0x17,0x11,0xe,0x0};
uint8_t heart[8] = {0x0,0xa,0x1f,0x1f,0xe,0x4,0x0};
uint8_t duck[8]  = {0x0,0xc,0x1d,0xf,0xf,0x6,0x0};
uint8_t check[8] = {0x0,0x1,0x3,0x16,0x1c,0x8,0x0};
uint8_t cross[8] = {0x0,0x1b,0xe,0x4,0xe,0x1b,0x0};
uint8_t retarrow[8] = { 0x1,0x1,0x5,0x9,0x1f,0x8,0x4};
   
LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD address to 0x27 for a 20 chars and 4 line display
 
void setup()
{
//  Serial.begin(57600);
  lcd.init();                      // initialize the lcd
  lcd.backlight();
   
  lcd.createChar(0, bell);
  lcd.createChar(1, note);
  lcd.createChar(2, clock);
  lcd.createChar(3, heart);
  lcd.createChar(4, duck);
  lcd.createChar(5, check);
  lcd.createChar(6, cross);
  lcd.createChar(7, retarrow);
  lcd.home();
   
  lcd.setCursor(0, 0);
  for(int i = 0;i < 20; i++)  lcd.printByte(6);
  lcd.setCursor(0, 1);
  lcd.printByte(6);
  lcd.print("   Hello world    ");
  lcd.printByte(6);
  lcd.setCursor(0, 2);
  lcd.printByte(6);
  lcd.print("  i ");
  lcd.printByte(3);
  lcd.print(" arduinos!   ");
  lcd.printByte(6);
  lcd.setCursor(0, 3);
  for(int i = 0;i < 20; i++)  lcd.printByte(6);
//  lcd.clear();
 
}
 
void loop()
{
 
}

from http://www.dfrobot.com/wiki/index.php/I2C_TWI_LCD2004_%28SKU:DFR0154%29.

but actually i own that one:

http://www.komputer.de/zen/index.php?main_page=product_info&cPath=30&products_id=49

but it worked very well.

So today i tried a little bit with DCF77 (didnt work), so i switched back to my Temperature-logging and displaying version, BUT DISPLAY didnt work again!

After hours and hours of searching i loaded the first example (that one above), and wonder: it worked again!

I uploaded my datalogger, diplay gave me tempertures. For about 30 minutes then again, dead. nothing is working.

That somehow looks to me as if im having a I2C-bus problem..... ??

I tried teh Lib posted here (moved LiquidCrystal_I2C and LiquidCrystal out of libraries folder), nothing. two lines on (no text), two lines off......

Any ideas?

BTW: I have a Mega R3, Display connecet to pins 20 an 21 (sda and scl) on mega....
Pages: [1]