Can be toogle button connected to analogpins?

Hello, I have a toogle button that always goes back to the center. Connect it to the analogPin A0 but in serial monitor is this. If I move the lever, nothings change. And i am beginer, and using a motor shield.

void setup() {
  pinMode(A0, INPUT_PULLUP);
  Serial.begin(9600);
}

void loop() {

  Serial.println(analogRead(A0));
  delay(50);
  

}

Wiring diagram please.
why analogRead()

Post a connection diagram.

can be a photo? I don't know how i can create wiring diagram sorry

why analogRead, just to look if the toogle button working

if now 1 or 0...

Use a piece of paper and pencil.

:neutral_face: i don't know how draw it, sorry.


is this enought?

hey!! i have it, thank you,

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.