Digital input with a pushbutton

I am not sure what you are trying to say

Upload this sketch

void setup()
{
    Serial.begin(115200);
    for (int p = 2; p < 13; p++)
    {
        pinMode(p, INPUT_PULLUP);
    }
}

void loop()
{
    for (int p = 2; p < 13; p++)
    {
        Serial.print("pin : ");
        Serial.print(p);
        Serial.print("\t\t");
        Serial.println(digitalRead(p) == HIGH ? "HIGH" : "LOW");
        delay(500);
    }
    Serial.println();
}

Remove everything connected to the Uno and open the Serial monitor and set it to 115200 baud. You should see HIGH reported for pins 2 to 12

Use a jumper to connect each pin 2 to 12 in turn to GND. For the pin connected to GND you should see LOW reported

It shows LOW for every pin

If it shows LOW for every pin when nothing is connected to any of them then your Uno is broken

What happens when you upload the Blink sketch to it ?

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