Texting with Giants
For the media controller project, Matt Epler, Sara Al-Bassam and I designed a giant phone button pad for typing out old-school texts.
The phone buttons were constructed from plexiglass, cardboard, and foam. The plexi provided a hard surface as a base, while two sheets of cardboard were coated with foil. A wire was underneath one of the foil sheets, so stepping on the button would complete the circuit. Matt explains the construction in this video:
One night, while working on the project, I thought it would be a good idea to test the conductivity of the buttons. The first button I tested didn’t work. Sara and I then tested all the buttons and found that none of them worked. It turned out that putting the wire underneath the foil didn’t provide enough contact to complete the circuit. We asked around the floor, and some second years provided us with a solution: conductive aluminum tape!
We covered the buttons in green felt, and laser cut the numbers and letters for them out of blue felt:
We had some difficulty getting the code to work fully. We were able to write code that worked for one button (ABC2), but when we extended it to multiple buttons, it wouldn’t type anything. Here is the working Arduino code:
[code lang="c"]//Texting logic test with switch. char btn2[] = {'A', 'B', 'C', '2'}; char c; int trueCnt = 0; const int switchPin = 2; int prevState = 0; int lastCtime=0; int btnTime = 500; void setup() { Serial.begin(9600); pinMode(switchPin, INPUT); } void loop() { int currState = digitalRead(switchPin); if(currState == 1 && prevState == 0) { if(millis() - lastCtime < btnTime){ trueCnt++; if(trueCnt > 3) { trueCnt = 0; } } c = btn2[trueCnt]; Serial.println(c); prevState = currState; lastCtime = millis(); } delay(10); if(prevState == 1 && currState == 0) { prevState = 0; } delay(10); if(millis()-lastCtime > btnTime){ trueCnt = 0; } }[/code]
Here is the Processing code:
[code lang="java"] import processing.serial.*; Serial myPort; int btnTime = 500; //time frame for 1 button press in ms String message = ""; int lastCtime=0; void setup() { size(1000, 1000); String portName = Serial.list()[0]; myPort = new Serial(this, portName, 9600); //frameRate(1); } void draw() { background(0); smooth(); textSize(40); text(message, 50, 50); println(message); } void serialEvent(Serial myPort) { String myString = myPort.readStringUntil('n'); if (myString != null) { myString = trim(myString); if (millis() - lastCtime < btnTime) { message = message.substring(0, message.length() - 1); } message = message + myString; lastCtime = millis(); } }[/code]