1

I got an 16x2 OLED Display (DEP 16201-Y , compatible to the HD44780 controller) for my Arduino Uno and I got it to work in 4-bit Mode.

Code:

#include <LiquidCrystal.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
void setup()
{
//lcd.clear();
 lcd.begin(16, 2);
 lcd.clear();
 lcd.setCursor(0,1);
 lcd.print("Hello there");
 delay(1000);
}
void loop()
{
 lcd.setCursor(0,1);
 lcd.print("Hello World");
 lcd.setCursor(0,0);
 lcd.print("ABCDEFGHIJKLM");
 delay(1800);
 lcd.clear();
}

I'm using the LiquidCrystal library as it is written for this controller.

The code is uploaded to the Arduino and now I power it via a normal power supply with 9V. Then it is pure luck at which position the Text appears. Most of the times at the programmed position but sometimes the hole text is shifted to the right or to the left.

In read in the .cpp file and it says, that the display won't be reseted when the Arduino is reset, so I assume the problem lays there, but I don't know how to fix it.

Thanks!

JRobert
15.4k3 gold badges24 silver badges51 bronze badges
asked Jul 27, 2017 at 12:01
4
  • I've indented your code (difficult to read & follow without it). Added missing ';' after the delay(1000) in setup(). Was that a copy/paste error or a bug? Commented Jul 27, 2017 at 12:28
  • I have had a similar module which has displayed similar problems - randomly the lines would swap over on a whim. The best I could get was to control the power to the module to give it a power cycle when needed. I gave up on it in the end, it seems to be an inherent problem with these displays. Commented Jul 27, 2017 at 12:34
  • @JRobert just a copy/paste error. Code works fine :) Thanks! Commented Jul 27, 2017 at 12:35
  • Same cause and solution as: arduino.stackexchange.com/questions/43080/… Commented Jul 27, 2017 at 15:35

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.