int main(int argc, char* argv[]) { for(int i=0; i<3; i++) { Display screen = Display(i); screen.clear(); screen.print("Display test", "COPTER"); screen.print("Testing, 1, 2, 1, 2"); screen.refresh(); usleep(5*1000*1000); } }
int App::run() { _mode = 1; _display.clear(); _display.gotoxy(Pos(0, 0)); if (_argc > 1) { _doc.open(_argv[1]); int lines = 0; for (int i = 0; i < 900 && lines < 24; i++) { int c = _doc.get(); if (c < 0) break; if (c == '\n') lines++; _display.putc(c); } } else { for (int i = 1; i < 24; i++) _display.write(Pos(0, i), 0x09, '~'); } _display.gotoxy(Pos(0, 0)); _display.setAttrLine(0, 0xf); uint16_t k; while (!_quit && (k = getch())) { switch (k) { case Keys::COLON: _display.gotoxy(Pos(0,24)); _display.setAttrLine(24, 0xf); _cmdLine.push(':'); _display.putc(':'); break; case Keys::ENTER: execute(_cmdLine); break; case Keys::BS: _cmdLine.pop(); _display.bs(); break; case Keys::ESC: _quit = true; break; default: _cmdLine.push(k); _display.putc(k); break; } } _display.setMode(3); return 0; }