void setup() {
// put your setup code here, to run once:
pinMode(5, INPUT);
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.print("porte3: ");
Serial.println(bitRead(PORTE, 3));
Serial.print("digiR5: ");
Serial.println(digitalRead(5));
}
You get current pin state with the PIN registers, not PORT. An input pin with nothing connected to it can read high or low at random - it's floating, so it will pick up noise from the environment like an antenna.