/* Input64 - show sixty-four input bits Requires the BigIOinput, Trixel and LiquidCrystal libraries and a 10x2 or better LCD display with 5 or more characters of font RAM. */ #include // 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); // initialize BigIOinput library with bit count BigIOinput input(64); 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("Input64 demo"); // show character message on LCD delay(1000); // for one second trix.clear(); // clear to white } void loop () { input.readByte(0, 64); for (int xy = 0; xy < 64; xy++) { uint8_t x = xy % 12; uint8_t y = xy / 12; trixel_color color = (trixel_color)input.bit(i); trix.setDot(x, y, color); } trix.show(); }