Pages: [1]   Go Down
Author Topic: IO Pins status  (Read 673 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Dave 
Logged

Offline Offline
God Member
*****
Karma: 32
Posts: 507
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Stimmer,

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

Dave
Logged

Pages: [1]   Go Up
Jump to: