Hi everybody! I can't poll the D7 port on the Arduino Nano Atmega168, it constantly outputs a logical zero to me, although the LED is powered in parallel on this pin, and the LED is lit. I did a port poll with do{// change port from input to output and from output to input} while (!(PIND & (1 << PD7)));
Tell me, what could be the reason for the incorrect polling of port D7?
Please show a correct code, which demonstrate the problem.
The voltage across the LED is below the threshold for logic 1.
1 Like
You did not use a resistor with the LED or its value is to low.
Arduino Pin 13 (LED_BUILTIN) is PB5, not PD7. The PD7 pin is Arduino Pin 7.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.