#ifndef __AVR__ /* This little block of code is to substitute for the Arduino LiquidCrystal library, in order to enable compilation and testing on non-Arduino platforms. For Arduino, you just need to have a global variable called "lcd" that is a pointer to a LiquidCrystal. */ #include using std::cout; using std::endl; struct LiquidCrystal { void clear() { cout << "-----" << endl; } void setCursor(int x, int y) { cout << endl; } void print(const char *s) { cout << s; } } _lcd, *lcd = &_lcd; #endif struct lcd_canvas { static void clear(void *) { lcd->clear(); lcd->setCursor(0, 0); } static void print(void *, int y, const char *s) { if (0 <= y && y <= 1) lcd->print(s); } static void println(void *, int y, const char *line) { if (0 <= y && y <= 1) { lcd->print(line); lcd->setCursor(0, y+1); } } };