Fix a couple of very subtle bugs, it seems like air delay < ~125 causes sensor 11 only (?) to read lower during slider calibration than during the main gameplay loop. Also forgot to remove the call to calibrate the slider keys inside the constructor.
This commit is contained in:
@@ -152,7 +152,7 @@ void AirSensor::analogCalibrate() {
|
||||
bool AirSensor::getSensorState(int sensor) {
|
||||
uint16_t value = getValue(sensor);
|
||||
|
||||
|
||||
/*
|
||||
Serial.print(sensor);
|
||||
Serial.print("\t");
|
||||
Serial.print(value);
|
||||
@@ -161,7 +161,7 @@ bool AirSensor::getSensorState(int sensor) {
|
||||
Serial.print("\t");
|
||||
Serial.print(thresholds[sensor]);
|
||||
Serial.println();
|
||||
|
||||
*/
|
||||
|
||||
#ifndef IR_SENSOR_ANALOG
|
||||
return value == LOW ? true : false;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <FastLED.h>
|
||||
|
||||
#define AIR_LED_DELAY 100
|
||||
#define AIR_LED_DELAY 125
|
||||
#define AIR_INPUT_DETECTION 0.90
|
||||
#define CALIBRATION_SAMPLES 200
|
||||
#define SKIP_SAMPLES 40
|
||||
|
||||
@@ -27,19 +27,19 @@ void AutoTouchboard::scan() {
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
for (int i = 0; i < 4; i++) {
|
||||
/*
|
||||
for (int i = 11; i < 12; i++) {
|
||||
Serial.print(key_values[i]);
|
||||
Serial.print("\t");
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 11; i < 12; i++) {
|
||||
Serial.print(triggerThresholdsSingle[i]);
|
||||
Serial.print("\t");
|
||||
}
|
||||
|
||||
Serial.println();
|
||||
*/
|
||||
*/
|
||||
}
|
||||
|
||||
void AutoTouchboard::calibrateKeys() {
|
||||
@@ -135,6 +135,4 @@ AutoTouchboard::AutoTouchboard() {
|
||||
pinMode(MUX_0, OUTPUT);
|
||||
pinMode(MUX_1, OUTPUT);
|
||||
pinMode(MUX_2, OUTPUT);
|
||||
|
||||
calibrateKeys();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class AutoTouchboard {
|
||||
private:
|
||||
// these will be tunable / need to be experimented with
|
||||
#if NUM_SENSORS == 32
|
||||
int deltaThreshold = 6;
|
||||
int deltaThreshold = 5;
|
||||
double releaseThreshold = 0.8;
|
||||
#else
|
||||
int deltaThreshold = 6;
|
||||
|
||||
@@ -73,7 +73,7 @@ void setup() {
|
||||
#endif
|
||||
|
||||
// Uncomment this to clear EEPROM, flash once, then comment and re-flash
|
||||
for(int i = 0; i < 128; i++) EEPROM.put(i, 0);
|
||||
// for(int i = 0; i < 128; i++) EEPROM.put(i, 0);
|
||||
|
||||
initializeController();
|
||||
lastMillis = millis();
|
||||
|
||||
Reference in New Issue
Block a user