/** * Minitel library for Arduino (v0.1) / May 2013 * http://github.com/01010101/Minitel * * By Jerome Saint-Clair aka 01010101 * http://saint-clair.net * * For the Graffiti Research Lab France * http://graffitiresearchlab.fr * * Based on works by the Tetalab (Fabrice, Renaud, PG & Phil) * http://tetalab.org */ #include #include Minitel m(6,7); void setup() { } void loop() { long pause = 2000; demoColor(); delay(pause); demoGraphics(false); delay(pause); demoGraphics(true); delay(pause); demoBip(); delay(pause); demoCursor(); delay(pause); demoText(); delay(pause); demoCharacters(); delay(pause); } /** * * DEMOS * */ // Graphic characters void demoGraphics(boolean underline) { m.clearScreen(); m.textMode(); m.textColor(WHITE); m.bgColor(RED); m.text(" GRAPHICS DEMO ", 4, 1); m.bgColor(BLACK); m.graphicMode(); if (underline) { m.pixelate(); } m.noCursor(); // No color m.useDefaultColors(); int xPos = 5; int yPos = 5; m.moveCursorTo(xPos, yPos); int x = 32; for (int i=x; iz m.moveCursorTo(xPos, yPos); for (int i=97; i<97+26; i++) { m.serialprint7(i); } // A->Z m.moveCursorTo(xPos, yPos+1); for (int i=65; i<65+26; i++) { m.serialprint7(i); } // 0-9 + punctuation marks, ... m.moveCursorTo(xPos, yPos+2); for (int i=33; i<33+32; i++) { m.serialprint7(i); } for (int i=91; i<97; i++) { m.serialprint7(i); } // Colored characters m.moveCursorTo(xPos, yPos+3); m.textColor(RED); for (int i=97; i<97+26; i++) { m.serialprint7(i); } m.textColor(WHITE); // Double width 1/2 m.moveCursorTo(xPos, yPos+4); m.charSize(SIZE_DOUBLE_WIDTH); for (int i=97; i<97+13; i++) { m.serialprint7(i); } m.moveCursorTo(xPos, yPos+5); for (int i=97+13; i<97+26; i++) { m.serialprint7(i); } m.charSize(SIZE_NORMAL); // Special characters m.moveCursorTo(xPos, yPos+6); byte chars[] = { SPE_CHAR_BOOK, SPE_CHAR_PARAGRAPH, SPE_CHAR_ARROW_LEFT, SPE_CHAR_ARROW_UP, SPE_CHAR_ARROW_RIGHT, SPE_CHAR_ARROW_DOWN, SPE_CHAR_CIRCLE, SPE_CHAR_MINUS_PLUS, SPE_CHAR_1_4, SPE_CHAR_1_2, SPE_CHAR_3_4, SPE_CHAR_UPPER_OE, SPE_CHAR_LOWER_OE, SPE_CHAR_BETA }; for (int i=0; i