B4R Question Wemos D1 mini with I2C LCD 16x2

Roger C

Active Member
Licensed User
Hi again,

Trying to connect the D1 mini to an I2C display but nothing happens.
Display is connected as this:
SDA to pin D2
SCL to pin D1

Has anyone done this and can share information?

I've tried this library but nothing on the screen.

I've scanned the I2C adresses with this code and got 0e27 so the hardware works.
 

derez

Expert
Licensed User
Please show the relevant code. How do you init ? :
B4X:
lcd.Initialize(0x3F, 16, 2) ' for 16X2 lcd
lcd.Initialize(0x27, 20, 4) ' for 20X4 lcd
 
Last edited:

Roger C

Active Member
Licensed User
Thanks positrom2 and derez.

A new day and a fresh start, suddenly things started to work.
I changed to UNO and the display worked. Then back to D1... and it worked.

Don't know what the problem was yesterday but thanks again.

This is the C++ code that works and prints Hello World!
B4X:
//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,16,2);  // set the LCD address to 0x27 for a 16 chars and 2 line display

void setup()
{
  lcd.init();                      // initialize the lcd
  lcd.init();
  // Print a message to the LCD.
  lcd.backlight();
  delay(5000);
  lcd.setCursor(0,0);
  lcd.print("Hello, world!");
}


void loop()
{
}
This is the Basic code.

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
    Public Serial1 As Serial
    Private lcd As LiquidCrystal_I2C
  End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart")
    
    lcd.Initialize(0x27, 16, 2) 'based on the example from the project.
    '   lcd.Initialize(0x27, 20, 4) ' for 20X4 lcd
    lcd.Backlight = True
    lcd.SetCursor(0,0)
    lcd.Write ("Row 1")
     lcd.SetCursor(0,1)
    lcd.Write("99999999")  ' this shows
 
End Sub
 
Top