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, but just if the USB isn't connected and it is powered by a 9V power supply.
So my routine is:
- Connect USB and power supply
- Upload Code
- --> Doesn't work
- Disconnect USB and power supply
- Just connect power supply
- --> Works
- Connect USB
- --> Display crashes
So basically: If the arduino is connected via USB to my PC, with or without an additional power supply, the display won't work properly, it will crash or the Arduino even restarts itself. (some kind of memory error?)
I have no possible explanation for this..
Thanks for your help.
EDIT: I'm running Ubuntu Mate Kernel 4.4.0-43-generic 64bit
If I plug in the cabel without power, display works fine. If I plug in the cabel with 5V, but the PC is shut down, the display works fine. For the display to crash, the pc has to be running.
Test 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();
}