diff --git a/examples/CapacitiveController/CapacitiveController.ino b/examples/CapacitiveController/CapacitiveController.ino index f87a47e..8885720 100755 --- a/examples/CapacitiveController/CapacitiveController.ino +++ b/examples/CapacitiveController/CapacitiveController.ino @@ -16,7 +16,7 @@ HIDKeyboard Keyboard(HID); unsigned pins[NUM_PINS] = {PA0,PA1,PA2,PA3,PA4,PA5,PA6,PA7,PB0,PB1}; unsigned keys[NUM_PINS] = {' ',KEY_UP_ARROW,KEY_LEFT_ARROW,KEY_DOWN_ARROW,KEY_RIGHT_ARROW,'w','a','s','d','f'}; // Makey-Makey also has 'g' and CLICK, but we don't have enough ADC channels unsigned buttons[NUM_PINS] = { 1, 0, 0, 0, 0, 2, 3, 4, 5, 6 }; -unsigned prev[NUM_PINS]; +unsigned previous[NUM_PINS]; ADCTouchSensor* sensors[NUM_PINS]; @@ -54,7 +54,7 @@ void setup() for (int i=0; ibegin(); - prev[i] = 0; + previous[i] = 0; } digitalWrite(LED_BUILTIN, 1); @@ -85,9 +85,9 @@ void loop() for (int i=0; iread() > 35) { pressed = 1; - if(!prev[i]) { + if(!previous[i]) { processPress(i); - prev[i] = 1; + previous[i] = 1; } if (joystickMode && buttons[i] == 0) { if (i==1) @@ -101,9 +101,9 @@ void loop() } } else { - if(prev[i]) { + if(previous[i]) { processRelease(i); - prev[i] = 0; + previous[i] = 0; } } } diff --git a/examples/CapacitivePiano/CapacitivePiano.ino b/examples/CapacitivePiano/CapacitivePiano.ino index 441fdce..7a7d0bc 100644 --- a/examples/CapacitivePiano/CapacitivePiano.ino +++ b/examples/CapacitivePiano/CapacitivePiano.ino @@ -44,7 +44,7 @@ const int numPins = sizeof(pins)/sizeof(*pins); const uint8_t NOTE_ON = 0b10010000; const uint8_t NOTE_OFF = 0b10000000; int ref[numPins]; -uint8_t prev[numPins]; +uint8_t previous[numPins]; ADCTouchSensor* sensors[numPins]; void setup() @@ -72,7 +72,7 @@ void setup() for (int i=0; ibegin(); - prev[i] = 0; + previous[i] = 0; } digitalWrite(LED_BUILTIN, 0^LED_OFF); @@ -103,15 +103,15 @@ void loop() for (int i=0; iread() > 25) { pressed = 1; - if(!prev[i]) { + if(!previous[i]) { midiNote(NOTE_ON, notes[i], 127); - prev[i] = 1; + previous[i] = 1; } } else { - if(prev[i]) { + if(previous[i]) { midiNote(NOTE_OFF, notes[i], 127); - prev[i] = 0; + previous[i] = 0; } } } diff --git a/examples/ShowButtons/ShowButtons.ino b/examples/ShowButtons/ShowButtons.ino index 4962232..4c34035 100755 --- a/examples/ShowButtons/ShowButtons.ino +++ b/examples/ShowButtons/ShowButtons.ino @@ -6,7 +6,7 @@ #define NUM_PINS 10 unsigned pins[NUM_PINS] = {PA0,PA1,PA2,PA3,PA4,PA5,PA6,PA7,PB0,PB1}; -unsigned prev[NUM_PINS]; +unsigned previous[NUM_PINS]; ADCTouchSensor* sensors[NUM_PINS]; @@ -20,7 +20,7 @@ void setup() for (int i=0; ibegin(); - prev[i] = 0; + previous[i] = 0; } digitalWrite(LED_BUILTIN, 1); @@ -34,15 +34,15 @@ void loop() for (int i=0; iread() > 35) { pressed = 1; - if(!prev[i]) { - prev[i] = 1; + if(!previous[i]) { + previous[i] = 1; Serial.println(String("Press: ")+i); } } else { - if(prev[i]) { + if(previous[i]) { Serial.println(String("Release: ")+i); - prev[i] = 0; + previous[i] = 0; } } } diff --git a/library.properties b/library.properties index 3b9622a..f570f71 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ADCTouchSensor -version=0.0.10 +version=0.0.12 author=Alexander Pruss maintainer=arpruss sentence=Create Touch Sensors with a single analog pin without external hardware