On the Uno R4 Minima and Uno R4 WiFi, pin 13 seems to be made an output after reset, so if you do:
void setup() {
Serial.begin(9600);
delay(5000);
}
void loop () {
Serial.println(digitalRead(13));
delay(1000);
}
and apply 5V to the pin (via a resistor for safety), you still get 0.
As far as I understand it the usual Arduino convention is that all digital pins are inputs after reset, and to make a pin an output you have to call pinMode(13, OUTPUT)
, for example.
The way it is currently working is undesirable, because you might have pin 13 connected to a voltage input; an accidental reset could then cause excessive dissipation in the output driver.