I would like to read out an analog pin and output the value on the serial monitor. it works with an arduino uno but not with an arduino nano 33 ble. what am I doing wrong ? a value of 0 is always output.
#define PotentioPin A7
int potentio = 0;
void setup() {
Serial.begin(9600);
delay(3000);
Serial.println("Test startet...");
delay(500);
}
void loop() {
potentio = lesePotentiometer(); // Simulation einer Lenkstangenneigung
Serial.println( potentio );
delay(1000);
//potentio = 1023 - potentio; // Abweichung Potentiometer von der Neutralstellung
}
int lesePotentiometer(){
int potentioMesswert;
potentioMesswert = analogRead(PotentioPin); // Rückgabewert 0...1023
Serial.println(potentioMesswert );
delay(1000);
return potentioMesswert;
}