Activity › Forums › Questions & Troubleshooting › AnalogRead results are different between Arduino MEGA and Controllino MAXI
-
AnalogRead results are different between Arduino MEGA and Controllino MAXI
-
For a project I want to determine a position using an FSLP (Force Sensing Linear Potentiometer)(The OHMITE FSP01CE for reference https://www.ohmite.com/assets/docs/controls_fsp.pdf?r=false).
I am using the following setup:
V1: attached to 5V
V2: attached to GND
Vwiper: attached to A0
And I am using this code to read the position:
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(analogRead(A0));
delay(100);
}When I run this code on the Arduino MEGA the following behaviour is observed:
- When not pressing the FSLP, the readings are random.
- When pressing the FSLP, the readings do not change depending on the force applied.
- When pressing the FSLP, the readings directly correlate to the position.
For the Controllino MAXI setup, I plugged the wires directly into the Pin Headers:
V1: attached to 5V
V2: attached to GND
Vwiper: attached to A0
And I am using this code to read the position:
#include <spi.h style="">
#include <controllino.h></controllino.h></spi.h>void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(analogRead(CONTROLLINO_A0));
delay(100);
}When I run this code on the Controllino MAXI the following behaviour is observed:
- When not pressing the FSLP, the readings are always 0.
- When pressing the FSLP, the readings DO change depending on the force applied.
- When pressing the FSLP, the readings only correlate to the position if I press hard.
Could someone explain to me why this happens and how I can get the Controllino to function the way the Arduino works?
Log in to reply.