Go Down

Topic: IO Pins status (Read 1 time) previous topic - next topic


Hi everyone,

I am new to this forum.  I got the new Due board a couple days ago.  So far so good.  But I noticed several things which are quite interesting.
1. When I set all the I/O pins as input, digitalRead reports they are all 'HIGH'.  Does that mean all the input pins have their internal pull-up resistors turned on?
2. When I set several I/O pins as output, digitalRead reports on those output pins are all 'HIGH' as well.  Does digitalRead reports the state of the output pins as well?  If not, is there a way I can read the current state of the output pins?

Please let me know.  Thanks in advance.



If you have written code it would really help us if you posted it here, then we can try running it and see if we get the same result. For 1 I suggest connecting a 1M resistor from an I/O pin to ground and measuring the voltage with a multimeter. For 2, there is a technical way of doing this (by reading PIO_ODSR), but I think it maybe should be a part of digitalRead - I can't remember how digitalRead worked on the Uno, but if it returned the current level of an output pin then we ought to make it work the same way on the Due.
Due VGA library - http://arduino.cc/forum/index.php/topic,150517.0.html


Hi Stimmer,

Thanks for your reply.  I got it to work.  My bitwise operator was wrong.  Thanks for your help.


Go Up