/* Count72 - count from 0 to 2^72 in binary Requires the Trixel and LiquidCrystal libraries and a 12x2 or better LCD display with 5 or more characters of font RAM. */ // LiquidCrystal.h must precede Trixel.h #include #include // initialize LiquidCrystal library with the interface pin numbers #if 0 LiquidCrystal lcd(12, 11, 5, 4, 3, 2); #else #define RS 11 // LCD 4 #define RW RW_GROUNDED #define Enable 12 // LCD 6 #define D4 4 // LCD 11 #define D5 5 // LCD 12 #define D6 6 // LCD 13 #define D7 7 // LCD 14 LiquidCrystal lcd(RS, Enable, D4, D5, D6, D7); #endif // initialize Trixel library with the LCD Trixel trix(&lcd); void setup() { lcd.begin(12, 2); // first set up LCD columns and rows trix.begin(12, 2); // next set up trixel buffer and LCD font RAM lcd.clear(); // unconfuse LCD after trixel init ??? lcd.print("Count72 demo"); // show character message on LCD delay(1000); // for one second } uint8_t count[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; void loop () { // show for (int xy = 0; xy < 72; xy++) { uint8_t x = xy % 12; uint8_t y = xy / 12; int i = xy / 8; int j = xy % 8; trixel_color color = (trixel_color)!(count[i] & (1<