Skip to content

Commit

Permalink
add another recalibration after startup demo, for bad touch / spotty …
Browse files Browse the repository at this point in the history
…power
  • Loading branch information
todbot committed Oct 22, 2024
1 parent aa99cc6 commit cc50789
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion firmware/TouchwheelSAO_attiny816/TouchwheelSAO_attiny816.ino
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void setup() {
Wire.onRequest(transmitDataWire);
Wire.begin(MY_I2C_ADDR);

// Touch buttons
// Touch buttons
for (int i = 0; i < touch_count; i++) {
touches[i].begin( touch_pins[i] );
touches[i].threshold = touches[i].raw_value * TOUCH_THRESHOLD_ADJ; // auto threshold doesn't work
Expand All @@ -191,6 +191,10 @@ void setup() {
void loop() {
if(do_startup_demo) {
startup_demo();
// recalibrate in case pads were being touched on power up (or power not stable)
for( int i=0; i< touch_count; i++) {
touches[i].threshold = touches[i].raw_value * TOUCH_THRESHOLD_ADJ; // auto threshold doesn't work
}
do_startup_demo = false;
}

Expand Down

0 comments on commit cc50789

Please sign in to comment.