Hi all.
My first post here and just with a library.
I've made a library for the DOG series of Electronic Assembly. Because it's not a normal HD44780 controller. The library is written like the LCD4Bit library. And it's one of my sources.
Datasheet of the Display http://www.lcd-module.de/eng/pdf/doma/dog-me.pdf
Datasheet of the Controller ST7036 http://www.lcd-module.de/eng/pdf/zubehoer/st7036.pdf
I'll try to upload some pictures and the wiring diagram.
The Sketch:
// examples of the DOGM_LCD library
#include <DOGM_LCD.h>
// create an object with the type of your Display
// EA DOGM081x-A (1x8 chars) -> 81
// EA DOGM162x-A (2x16 chars) -> 162
// ES DOGM163x-A (3x16 chars) -> 163
DOGM_LCD lcd = DOGM_LCD(163);
int i;
int x;
char string[3];
void setup() {
lcd.init();
}
void loop() {
// ##########
lcd.gotoxy(2,1);
lcd.printStr("Hello World!");
delay(2000);
// ##########
lcd.clear(); // clear the Display
lcd.contrast(0); // set contrast to 0 (nothing to see)
lcd.gotoxy(3,1);
lcd.printStr("Fade in...");
for (i=0; i<64; i++) {
lcd.contrast(i);
delay(50);
}
delay(2000);
// ##########
lcd.home(); // position of teh cursor at home (0,0)
lcd.printStr("01234567890123456");
lcd.gotoxy(0, 1);
lcd.printStr("ABCDEFGHIJKLMNOP");
lcd.gotoxy(0, 2);
lcd.print(0x08); // print out some special chars
lcd.print(0x09);
lcd.print(0x0A);
lcd.print(0x0B);
lcd.print(0x0C);
lcd.print(0x0D);
lcd.print(0x0E);
lcd.print(0x0F);
lcd.print(0xF8);
lcd.print(0xF9);
lcd.print(0xFA);
lcd.print(0xFB);
lcd.print(0xFC);
lcd.print(0xFD);
lcd.print(0xFE);
lcd.print(0xFF);
delay(2000);
for (i=63; i>=0; i--) {
lcd.contrast(i);
delay(50);
}
lcd.clear();
lcd.contrast(32);
// ##########
for (x=0; x<100; x++) {
itoa(x, string, 10);
lcd.gotoxy(14,2);
lcd.printStr(string);
delay(50);
}
}
The Header:
#ifndef DOGM_LCD_h
#define DOGM_LCD_h
#include <inttypes.h>
class DOGM_LCD {
public:
DOGM_LCD(int type);
void cmd_nibble(int nibble);
void cmd(int value);
void init();
void clear();
void home();
void gotoxy(int x, int y);
void printStr(char value[]);
void print(int value);
void contrast(int value);
private:
void pulse_enable();
void chkbusy();
void push_nibble(int nibble);
void push_byte(int value);
};
#endif