======= Coding Minitel ====== Code Arduino du chat codé en live au Parc de Montreau en juin 2019 #include #include Minitel m1; int delay_var = 2000;; void setup() { m1.textMode(); m1.clearScreen(); m1.noCursor(); } int a, b; void loop() { screenChange(); delay(random(4000)); /*This code moves the cat from left to right on the screen a++; a = a % 24; if(a==0) b++; b=b%40; */ a = 4 * cos(millis() / 100.)+10; b = 4 * sin(millis() / 100.)+6; drawCat(a, b); } void screenChange() { delay(delay_var); m1.clearScreen(); } void drawCat(int x, int y) { m1.text("_", x + 3, y + 1); m1.text("( \\", x + 2, y + 2); m1.text(") )", x + 3, y + 3); m1.text("( ( .-''''-. A.-.A", x + 2, y + 4); m1.text("\\ \\/ \\/ , , \\", x + 3 , y + 5); m1.text("\\ \\ =; t /=", x + 4 , y + 6); m1.text("\\ \\''''- ',--'", x + 5, y + 7); m1.text("/ // \\ \\\\", x + 7, y + 8); m1.text("/_,)) \\_,))", x + 6, y + 9); }