Report Bugs Here

Moderator: Mmiscool

User avatar
By Alberto_2
#73563 I am facing the following problem: Pin D3 is set low with istruction "io(po,0,0)" and it does switch to low.
Then I want to read the pin status using instruction "VV = io(pi,0)" and VV is equal to 1 and the pin is ON as well. Readind status of pin D7 the pin remains stable and the logic value reported by "io(pi,13)" is correct.

At the moment I must avoid to read status of the pin D3 to avoid to turn on the pin when it should not.
User avatar
By Alberto_2
#73630 OK! Understood the problem. Reading the input with instruction "io(pi,d3)" make the pin an input pin, so the pullup resistor switch the pin to logic 1. This means I have to take track of the output status using a status variable and refer to this variable all the time I need to know the logic status of my output.
I have also learned that d3 is critical when used as an output! So I will swap pins and use d3 as imput and d6 as output.