At the moment i am working on my Geiger-counter which is based on this hardware, but has many more features added to it (GPS, SD-Card and Buttons). I will post more information as soon as i managed to fixate the last piece of hardware in the case.
While working on it i wanted to have a luminous LCD display and stumbled over a very nice piece of hardware: OLED displays from Electronic Assembly.
OLED displays have many advantages over classical LCD displays:
- Low power consumption
- Perfect contrast
- No viewing angle
- Background is really Black
But after ordering a 2x16 OLED display for round about 30 euros from Reichelt i was not able to correctly use it with the Arduino LiquidCrystal library, it showed most the time pixel garbage.
At first i thought the display was broken, but as i was digging deeper into the matter i found that this display is only HD44780 controller "compatible". What that means depends on the manufacturer.
After weeks of experimenting and reading tons of documentation i was finally able to drive the display (almost) without errors.
I have written my own minimal LCD "framework" to drive my OLED, mainly because the OLEDs from Electronic Assembly will most the time not work correctly with the Arduino library.
The cause is that the OLEDs use a different initiation command order and are reacting VERY strange if one does not follow them.
Driving a HD44780 compatible LCD is simply a pain in the ass. The command structure is not that hard to understand, but ambiguously written documentation and the sensitive behavior on the timing of the commands is not really helpful.
So here i present you my framework, published under GPL for your using pleasure.
The framework is intentionally stripped to the bare bone, the absolute minimum to use the LCD, there are no "convenience methods". It is written for 2x16 character displays but it will work with other ones if you adapt the code. The advantage is that it is only 70 lines in size (with commentary!) instead of 400 lines on the Arduino LiquidCrystal library.
The framework will also work with "real" HD44780 displays, i tested it with the old display which was bundled with the Geiger counter board.
I hope it will be as useful for you as it is for me, although i give no guarantee for it.
Download: TimeWasters LCD Framework v1.0