From 28b1b2784d51aa62a580d66d3f74e9d0bbb64715 Mon Sep 17 00:00:00 2001 From: Fisch Date: Sat, 15 Jan 2022 13:04:58 +0100 Subject: [PATCH] debug output prints --- touchcontroller/src/main.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/touchcontroller/src/main.cpp b/touchcontroller/src/main.cpp index b4f37c6..8db8487 100644 --- a/touchcontroller/src/main.cpp +++ b/touchcontroller/src/main.cpp @@ -10,7 +10,8 @@ uint16_t countedLow[INPUTS]; //count the times input was below threshold (touche // Inputdelay is given by: COUNTEDLOWTHRESHOLD*ADCREADINTERVAL unsigned long last_adcmicros=0; -#define ADCREADINTERVAL 2000 //in microseconds. interval to read all adc values +//#define ADCREADINTERVAL 2000 //in microseconds. interval to read all adc values +#define ADCREADINTERVAL 20000 //in microseconds. interval to read all adc values unsigned long last_send=0; #define MINIMUMSENDDELAY 10 //in milliseconds. minimum delay between serial sends @@ -19,14 +20,14 @@ void setup() { pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, LOW); - pinMode(A0, INPUT); - pinMode(A1, INPUT); - pinMode(A2, INPUT); - pinMode(A3, INPUT); - pinMode(A4, INPUT); - pinMode(A5, INPUT); - pinMode(A6, INPUT); - pinMode(A7, INPUT); + pinMode(A0, INPUT_PULLUP); + pinMode(A1, INPUT_PULLUP); + pinMode(A2, INPUT_PULLUP); + pinMode(A3, INPUT_PULLUP); + pinMode(A4, INPUT_PULLUP); + pinMode(A5, INPUT_PULLUP); + pinMode(A6, INPUT_PULLUP); + pinMode(A7, INPUT_PULLUP); Serial.begin(115200); } @@ -50,6 +51,11 @@ void loop() { //Serial.print(": "); //Serial.println(micros()-mic); + Serial.print(rawIn[1]); + Serial.print(", "); + Serial.print(rawIn[1]); + Serial.println(); + for (uint8_t i=0;i