Skip to main content
Arduino

Return to Question

Notice removed Draw attention by Community Bot
Bounty Ended with no winning answer by Community Bot
Tweeted twitter.com/StackArduino/status/783090244509921280
added the final, working, sketch
Source Link
Thijs
  • 432
  • 1
  • 6
  • 21

[EDIT]

Final sketch:

#include <TinyWireM.h> // I2C Master lib for ATTinys which use USI
// #include <LiquidCrystal_I2C.h>
#include "LiquidCrystal_attiny.h"
LiquidCrystal_I2C lcd(0x27,16,2);
void setup() {
 
 // Now set up the LCD
 //lcd.begin(16,2); // initialize the lcd
 pinMode(4, OUTPUT);
 lcd.init();
 lcd.backlight();
 lcd.home (); // go home
 lcd.print("Weatherstation");
 lcd.setCursor ( 0, 1 ); // go to position
 lcd.print("BMP180");
 delay(2000);
}
void loop() {
 digitalWrite(4, HIGH);
 delay(100);
 digitalWrite(4, LOW);
 delay(100);
}

[EDIT]

Final sketch:

#include <TinyWireM.h> // I2C Master lib for ATTinys which use USI
// #include <LiquidCrystal_I2C.h>
#include "LiquidCrystal_attiny.h"
LiquidCrystal_I2C lcd(0x27,16,2);
void setup() {
 
 // Now set up the LCD
 //lcd.begin(16,2); // initialize the lcd
 pinMode(4, OUTPUT);
 lcd.init();
 lcd.backlight();
 lcd.home (); // go home
 lcd.print("Weatherstation");
 lcd.setCursor ( 0, 1 ); // go to position
 lcd.print("BMP180");
 delay(2000);
}
void loop() {
 digitalWrite(4, HIGH);
 delay(100);
 digitalWrite(4, LOW);
 delay(100);
}
Mod Moved Comments To Chat
Notice added Draw attention by Thijs
Bounty Started worth 100 reputation by Thijs
Source Link
Thijs
  • 432
  • 1
  • 6
  • 21

ATTiny85 I2C LCD

My setup is as follows:

  • Arduino IDE 1.6.11
  • Arduino Pro Mini as ISP
  • ATTiny85 1602A LCD with I2C board

The libraries I use are:

The Sketch I use to test with:

#include <TinyWireM.h> 
#include <LiquidCrystal_I2C.h> 
LiquidCrystal_I2C lcd(0x3F,16,2); // set address & 16 chars / 2 lines
void setup()
{
 TinyWireM.begin(); // initialize I2C lib
 lcd.init(); // initialize the lcd 
 lcd.backlight(); 
 lcd.clear(); // Print a message to the LCD.
}
void loop()
{
 lcd.setCursor(0, 0);
 lcd.print("Hello World on Attiny85");
 delay(2000);
}

The address is 0x3F, I found this using the scanner sketch, I also tested the LCD using the Arduino Pro Mini directly, it works fine.

The result of this setup is a single line of black blocks. My guess is that the initialization failed in some way. I have tried some things to make it work:

  • Pull-ups on SDA and SCL
  • Isolated from Arduino with regulated power supply
  • Setting contract with the pot meter on the back
  • reinstall of PC
  • reinstall of Arduino IDE
  • 1MHz, 8Mhz, TinyCore default and High-Low Tech
  • Replaced FTDI
  • Replaced Tiny85
  • Replaced LCD
  • Replaced Arduino Pro Mini

Some pictures:

back of the display

the blocks

connections

AltStyle によって変換されたページ (->オリジナル) /