Netušíte kde může být problém?
troubleshooting je, že prostě na A0 není nic připojeno, tedy napětí je 0V a výsledek v serial screenu je 250 nikoli 0
Kód: Vybrat vše
int analogPin = 0; // potentiometer wiper (middle terminal) connected to analog pin 3
// outside leads to ground and +5V
int val = 0; // variable to store the value read
void setup()
{
Serial.begin(9600); // setup serial
}
void loop()
{
val = analogRead(analogPin); // read the input pin
Serial.println(val); // debug value
}