gaplauncher
Member
Hello everybody,
i have a very strange problem with the signal of a Tekscan Flexiforce Sensor to be used in a hardware game controller (pedals).
This is my sketch:
The teensy is recognized as a game controller in windows, all defined axis are recognized and working.
But i have a strange problem with the signals of the Felxiforce Sensors (FSR_PIN1 and FSR
_PIN2)
Hookup is made like this as shown in a hookup guide:
https://cdn.sparkfun.com/assets/learn_tutorials/5/1/0/fritzing_example_bb_2.png
In the Arduino Plotter the output looks like this:
When i apply pressure on the sensors the signal jumps up at a certain point and continues to raise, same behaviour when i release pressure.
The problem is not hardware or temperature related. When i change the resistor, therefore can measure higher or lower pressures, i have the signal jump at approx. the same values.
So i therefore suppose that the sensors are fine.
In my oppinion there has to be a problem in the electrical hookup or the program or whatever.
I´m really stuck here and would need some help or thoughts!?
Thanks in advance!
Cheers Dan
i have a very strange problem with the signal of a Tekscan Flexiforce Sensor to be used in a hardware game controller (pedals).
This is my sketch:
Code:
//-------------------------------------------------------------------------------------
// Flexiforce SimCylinder Sketch
// 3x Flexiforce A301/201 Brake 1, Brake 2, Clutch
//
//-------------------------------------------------------------------------------------
#include <ResponsiveAnalogRead.h> // https://github.com/dxinteractive/ResponsiveAnalogRead
//Pedalachsen
const int FSR_PIN1 = 20; // Flexiforce1 Bremse vorn; Pin connected to FSR/resistor divider
const int FSR_PIN2 = 21; // Flexiforce2 Bremse hinten; Pin connected to FSR/resistor divider
const int FSR_PIN3 = 22; // Flexiforce3 Kupplung; Pin connected to FSR/resistor divider
const int FLEX_PIN = 23; // Flexsensor Gas; Pin connected to voltage divider output
ResponsiveAnalogRead analog(FLEX_PIN, true);
void setup() {
ResponsiveAnalogRead analog(FLEX_PIN, true);
//Setup Flexiforce + Flex-Sensor
pinMode(FSR_PIN1, INPUT); //Flexiforce1 Bremse vorn
pinMode(FSR_PIN2, INPUT); //Flexiforce2 Bremse hinten
pinMode(FSR_PIN3, INPUT); //Flexiforce3 Kupplung
pinMode(FLEX_PIN, INPUT); //Flexsensor Gas
//deactivate Joystick Hat
Joystick.hat(-1);
Joystick.Y(-1);
}
void loop(void) {
analog.update();
Joystick.sliderLeft(analogRead(FSR_PIN1)); // Bremskreislauf vorne
Joystick.sliderRight(analogRead(FSR_PIN2)); // Bremskreislauf hinten oder Handbremse
//Joystick.Y(analogRead(FSR_PIN3)); // Kupplung
if (analog.hasChanged()) {
// Input 3 axis: read analog inputs from potentiometer and set Z-position (Gas)
Joystick.Zrotate(analogRead(FLEX_PIN)); // Achse Gas pin 23 an teensy
}
//delay(50);
}
The teensy is recognized as a game controller in windows, all defined axis are recognized and working.
But i have a strange problem with the signals of the Felxiforce Sensors (FSR_PIN1 and FSR
_PIN2)
Hookup is made like this as shown in a hookup guide:
https://cdn.sparkfun.com/assets/learn_tutorials/5/1/0/fritzing_example_bb_2.png
In the Arduino Plotter the output looks like this:
When i apply pressure on the sensors the signal jumps up at a certain point and continues to raise, same behaviour when i release pressure.
The problem is not hardware or temperature related. When i change the resistor, therefore can measure higher or lower pressures, i have the signal jump at approx. the same values.
So i therefore suppose that the sensors are fine.
In my oppinion there has to be a problem in the electrical hookup or the program or whatever.
I´m really stuck here and would need some help or thoughts!?
Thanks in advance!
Cheers Dan