/* * CLCD.h - Arduino library for CharacterLCD - header for C++ adaptation * by Homin Lee (Suapapa) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 * as published by the Free Software Foundation. You should have received * a copy of the license along with this program. * If not, see . */ #ifndef CLCD_H #define CLCD_H //#include //#include "stdio.h" #include "WConstants.h" #define CLCD_EXCLUDE_8BIT_INTERFACE #define CLCD_ITOA_BUF_LEN 12 class CLCD { public: CLCD(uint8_t RS, uint8_t RW, uint8_t EN, uint8_t *DBUS, uint8_t busLen=8); void init(void); void clear(void); void command(uint8_t cmd); void putChar(char ch); void putStr(char str[]); void putDec(int num); void setCursor(uint8_t line, uint8_t index); private: uint8_t _pinRS;// = 14; uint8_t _pinRW;// = 15; uint8_t _pinEN;// = 16; uint8_t *_busData;// = {11, 10, 9, 8, 4, 5, 6, 7}; #ifdef CLCD_INCLUDE_8BIT_INTERFACE uint8_t _busLenth; //8 or 4 #endif char _itoaBuf[CLCD_ITOA_BUF_LEN+1]; uint8_t _itoa(int n); void _putNibble(uint8_t data); void _putByte(uint8_t data); }; #endif