/* Wave64 - Mama's BIG-IO-input 64 bit capacitive hand-waving sensor Requires the BigIOinput, Trixel and LiquidCrystal libraries, a 64-bit parallel to serial input card and a 12x2 or better LCD display with 5 or more characters of font RAM. http://csail.mit.edu/~devon/Arduino/BigIOinput http://csail.mit.edu/~devon/Arduino/Trixel */ #include // LiquidCrystal.h must precede Trixel.h #include #include /* initialize LiquidCrystal library with the interface pin numbers Arduino <===> MotherboardShield <===> Mama's LCD Card <===> Mama's BIG-IO-input Card <===> USB Serial <===> Programmer Arduino Pin# System Signal ---- ------ ------ 0 Serial RX 1 Serial TX 2 3 4 LCD D4 5 LCD D5 6 LCD D6 7 LCD D7 8 BI Shift 9 BI Enable 10 BI Clock 11 LCD RS 12 LCD ENABLE 13 Serial uses pins 0,1 BigIOinput uses pins 8, 9, 10 ??? LCD uses pins 4,5,6,7,11,12 */ #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); // BIG-IO-input 64 uses pins 8, 9, 11, 12 #define BI_Enable 9 #define BI_Shift 8 #define BI_Clock 12 #define BI_P1_Out BigIOinput input(64, 8, 9, 10); void setup() { lcd.begin(12, 2); // first set up LCD columns and rows trix.begin(12, 2); // then set up trixel buffer and LCD font RAM lcd.home(); // unconfuse LCD after trixel init ??? lcd.print("wave hands"); // show instructions on LCD ... lcd.setCursor(0, 1); lcd.print(" over inputs"); delay(1000); // for a second } void loop () { // continuously monitor all 64 input bits on LCD for (int position = 0; position < 64; position++) { int x = position / 6; int y = position % 6; boolean bit = input.read(position); trixel_color color = (trixel_color)!bit; trix.setDot (x, y, color); } trix.show(); }