Compare commits
No commits in common. "d0f78ab0d8a23fb2fc1307315fb613312ef14a33" and "577e5eaf8d07649d2131b00c2afaee8b46fb5975" have entirely different histories.
d0f78ab0d8
...
577e5eaf8d
|
@ -10,8 +10,7 @@ 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 20000 //in microseconds. interval to read all adc values
|
||||
#define ADCREADINTERVAL 2000 //in microseconds. interval to read all adc values
|
||||
|
||||
unsigned long last_send=0;
|
||||
#define MINIMUMSENDDELAY 10 //in milliseconds. minimum delay between serial sends
|
||||
|
@ -20,14 +19,14 @@ void setup() {
|
|||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
digitalWrite(LED_BUILTIN, LOW);
|
||||
|
||||
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);
|
||||
pinMode(A0, INPUT);
|
||||
pinMode(A1, INPUT);
|
||||
pinMode(A2, INPUT);
|
||||
pinMode(A3, INPUT);
|
||||
pinMode(A4, INPUT);
|
||||
pinMode(A5, INPUT);
|
||||
pinMode(A6, INPUT);
|
||||
pinMode(A7, INPUT);
|
||||
Serial.begin(115200);
|
||||
}
|
||||
|
||||
|
@ -51,11 +50,6 @@ 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<INPUTS;i++){ //for all inputs
|
||||
if (rawIn[i]<=TOUCHTHRESHOLD) { //touch detected (input low at this sample)
|
||||
countedLow[i]++; //increase counter
|
||||
|
@ -89,7 +83,7 @@ void loop() {
|
|||
touchOut=newTouch; //update
|
||||
last_send=loopmillis;
|
||||
//Serial.println(touchOut, BIN); //Debug output
|
||||
//Serial.write(touchOut); //Send byte
|
||||
Serial.write(touchOut); //Send byte
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue