Greetings everyone,
I'm making a glove with 5 fingers, using Teensy 3.2, where each finger has 3 copper pads which should give out different resistance values.
I tested ADCTouch library from
on Arduino Uno, and it worked well, I could divide the values into 3 categories.
But when I tested it on Teensy 3.2, it says "Error compiling for board Teensy 3.2 / 3.1.". My whole project has the Teensy as the brain, so i need it on Teensy. I would appreciate it a lot if someone could help me modify the libraries so I can use the same code on Teensy, or if someone suggests a code with which I can read the capacitive resistance of the copper pads
Buttons.ino
Thanks
I'm making a glove with 5 fingers, using Teensy 3.2, where each finger has 3 copper pads which should give out different resistance values.
I tested ADCTouch library from
HTML:
https://github.com/martin2250/ADCTouch/blob/master/examples/Buttons/Buttons.ino
But when I tested it on Teensy 3.2, it says "Error compiling for board Teensy 3.2 / 3.1.". My whole project has the Teensy as the brain, so i need it on Teensy. I would appreciate it a lot if someone could help me modify the libraries so I can use the same code on Teensy, or if someone suggests a code with which I can read the capacitive resistance of the copper pads
Buttons.ino
Code:
#include <ADCTouch.h>
int ref0, ref1; //reference values to remove offset
void setup()
{
// No pins to setup, pins can still be used regularly, although it will affect readings
Serial.begin(9600);
ref0 = ADCTouch.read(A0, 500); //create reference values to
ref1 = ADCTouch.read(A1, 500); //account for the capacitance of the pad
}
void loop()
{
int value0 = ADCTouch.read(A0); //no second parameter
int value1 = ADCTouch.read(A1); // --> 100 samples
value0 -= ref0; //remove offset
value1 -= ref1;
Serial.print(value0 > 40); //send (boolean) pressed or not pressed
Serial.print("\t"); //use if(value > threshold) to get the state of a button
Serial.print(value1 > 40);
Serial.print("\t\t");
Serial.print(value0); //send actual reading
Serial.print("\t");
Serial.println(value1);
delay(100);
}
Thanks