// // raspCLCD: Raspberry Pi CLCD (Character LCD) module (using 4bit parallel) // xkozima@myu.ac.jp #ifndef CLCD_H #define CLDC_H #include #include "raspGPIO.h" // キャラクタ液晶ディスプレーへの接続線 (SD1602H) // (注: LCD_RW は Vss (GND) に固定) #define CLCD_RS 14 // #08 #define CLCD_E 15 // #10 #define CLCD_DB4 18 // #12 #define CLCD_DB5 23 // #16 (#14=GND) #define CLCD_DB6 24 // #18 #define CLCD_DB7 25 // #22 (#20=GND) class CLCD { public: // CLCD 初期化(最初に1回呼び出す) void init(); // 表示クリア void clear(); // カーソル位置を設定 void locate(int x, int y); // カーソル位置に文字列を表示 void print(const char *buf); private: void sendCommand4(unsigned char command); // send 4bit command void sendCommand8(unsigned char command); // send 8bit command void sendData8(unsigned char data); // send 8bit data }; #endif