/* Simple LCD Character Display - see http://www.technoblogy.com/show?2BET David Johnson-Davies - www.technoblogy.com - 15th September 2018 ATmega328 @ 8MHz (internal oscillator; BOD disabled) CC BY 4.0 Licensed under a Creative Commons Attribution 4.0 International license: http://creativecommons.org/licenses/by/4.0/ */ // Pin definitions - these are all pin numbers in PORTD (and Arduino pin numbers) const int data = 1; // PD1 to PD4 connect to D4 to D7 on the display const int enable = 5; // PD5 const int rs = 0; // PD0 class LCD : public Print { public: void init(); void cmd(uint8_t); size_t write(uint8_t); private: void nib(uint8_t); }; void LCD::init () { DDRD = DDRD | 0xF<>4); nib(b&0xf); return 1; } // Send command void LCD::cmd (uint8_t c) { PORTD = PORTD & ~(1<