diff options
author | Christopher Baines <cbaines8@gmail.com> | 2011-09-14 14:41:46 +0100 |
---|---|---|
committer | Christopher Baines <cbaines8@gmail.com> | 2011-09-14 14:41:46 +0100 |
commit | d3aa36dfa804686ebc60eeb32c59f53d681d5e0c (patch) | |
tree | 0318b70ff4f61dab095fa9f721fb9b118df816a8 /Arduino/ButtonMatrix | |
parent | ae8432ffe5cea8421b04068d0fe62d8e15175505 (diff) | |
download | punchingbag-d3aa36dfa804686ebc60eeb32c59f53d681d5e0c.tar punchingbag-d3aa36dfa804686ebc60eeb32c59f53d681d5e0c.tar.gz |
More serial improements, Giggle and SimpleKeyboard now work, kinda.
Diffstat (limited to 'Arduino/ButtonMatrix')
-rwxr-xr-x | Arduino/ButtonMatrix/ButtonMatrix.pde | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/Arduino/ButtonMatrix/ButtonMatrix.pde b/Arduino/ButtonMatrix/ButtonMatrix.pde index d3a0874..0956659 100755 --- a/Arduino/ButtonMatrix/ButtonMatrix.pde +++ b/Arduino/ButtonMatrix/ButtonMatrix.pde @@ -31,28 +31,28 @@ const int id = 1; */ char keys[COLS][ROWS] = { { - 1, 9, 17, 25, 33, 41, 49, 57, 65, 73, 81, 89, 97, 105, 113, 121, 129, 137, 145 } + 1, 9, 17, 25, 33, 41, 49, 57, 65, 73, 81, 89, 97, 105, 113, 121, 129, 137, 145 } , { - 2, 10, 18, 26, 34, 42, 50, 58, 66, 74, 82, 90, 98, 106, 114, 122, 130, 138, 146 } + 2, 10, 18, 26, 34, 42, 50, 58, 66, 74, 82, 90, 98, 106, 114, 122, 130, 138, 146 } , { - 3, 11, 19, 27, 35, 43, 51, 59, 67, 75, 83, 91, 99, 107, 115, 123, 131, 139, 147 } + 3, 11, 19, 27, 35, 43, 51, 59, 67, 75, 83, 91, 99, 107, 115, 123, 131, 139, 147 } , { - 4, 12, 20, 28, 36, 44, 52, 60, 68, 76, 84, 92, 100, 108, 116, 124, 132, 140, 148 } + 4, 12, 20, 28, 36, 44, 52, 60, 68, 76, 84, 92, 100, 108, 116, 124, 132, 140, 148 } , { - 5, 13, 21, 29, 37, 45, 53, 61, 69, 77, 85, 93, 101, 109, 117, 125, 133, 141, 149 } + 5, 13, 21, 29, 37, 45, 53, 61, 69, 77, 85, 93, 101, 109, 117, 125, 133, 141, 149 } , { - 6, 14, 22, 30, 38, 46, 54, 62, 70, 78, 86, 94, 102, 110, 118, 126, 134, 142, 150 } + 6, 14, 22, 30, 38, 46, 54, 62, 70, 78, 86, 94, 102, 110, 118, 126, 134, 142, 150 } , { - 7, 15, 23, 31, 39, 47, 55, 63, 71, 79, 87, 95, 103, 111, 119, 127, 135, 143, 151 } + 7, 15, 23, 31, 39, 47, 55, 63, 71, 79, 87, 95, 103, 111, 119, 127, 135, 143, 151 } , { - 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152 } + 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152 } }; byte colPins[COLS] = { @@ -108,7 +108,12 @@ boolean runSerialTest() { void loop(){ - Serial.write('B'); + int ax = analogRead(axpin); + int ay = analogRead(aypin); + int bx = analogRead(bxpin); + int by = analogRead(bypin); + + Serial.print("B"); Serial.print(" "); char customKey = keypad.getKey(); int customKeyInt = customKey; @@ -117,27 +122,28 @@ void loop(){ Serial.print(customKeyInt); } Serial.println(); - - Serial.write('A'); + + Serial.print("A"); Serial.print(" "); // print the sensor values: - Serial.print(analogRead(axpin)); + Serial.print(ax); // print a tab between values: Serial.print(" "); - Serial.print(analogRead(aypin)); + Serial.print(ay); Serial.print(" "); // print the sensor values: - Serial.print(analogRead(bxpin)); + Serial.print(bx); // print a tab between values: Serial.print(" "); - Serial.println(analogRead(bypin)); + Serial.println(by); // print a tab between values: // delay before next reading: - //delay(10);*/ - delay(100); + delay(60); + //delay(100); } + |