/** * 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; i?@[\\]",xPos, yPos+3); m.moveCursorTo(xPos, yPos+2); m.serialprint7(96); m.serialprint7(95); m.serialprint7(94); m.serialprint7(123); m.serialprint7(124); m.serialprint7(125); m.serialprint7(126); // Colored characters m.moveCursorTo(xPos, yPos+4); m.textColor(RED); for (int i=97; i<97+26; i++) { m.serialprint7(i); } m.textColor(WHITE); // Double width 1/2 m.charSize(SIZE_DOUBLE_WIDTH); m.text("abcdefghijklmnopqrstuvwxyz", xPos, yPos+5); m.text("ABCDEFGHIJKLMNOPQRSTUVWXYZ", xPos, yPos+6); m.charSize(SIZE_NORMAL); // Special characters m.moveCursorTo(xPos, yPos+7); byte chars[] = { SPE_CHAR_POUND, SPE_CHAR_DOLLAR, SPE_CHAR_HASHTAG, SPE_CHAR_PARAGRAPH, SPE_CHAR_ARROW_LEFT, SPE_CHAR_ARROW_UP, SPE_CHAR_ARROW_RIGHT, SPE_CHAR_ARROW_DOWN, SPE_CHAR_DEGREE, SPE_CHAR_MINUS_PLUS, SPE_CHAR_DIVIDE, SPE_CHAR_1_4, SPE_CHAR_1_2, SPE_CHAR_3_4, SPE_CHAR_GRAVE, SPE_CHAR_ACUTE, SPE_CHAR_CIRCUMFLEX, SPE_CHAR_UMLAUT, SPE_CHAR_CEDIL, SPE_CHAR_UPPER_OE, SPE_CHAR_LOWER_OE, SPE_CHAR_BETA //SPE_CHAR_ARROW_UP2, //SPE_CHAR_PIPE_BOTTOM, //SPE_CHAR_PIPE_MIDDLE, //SPE_CHAR_PIPE_LEFT, //SPE_CHAR_PIPE_CENTER, //SPE_CHAR_PIPE_RIGHT, //SPE_CHAR_PIPE_TOP }; for (int i=0; i