Okay, so I found
Use GPIO pins from userspace, where it does describe what you're doing, and everything looks right according to that description. It would have been helpful for you to post a link to that page, but I see that your low post-count would probably prohibit that.
Have you tried another IO bit? Are you sure you are actually measuring the correct pin? Pins on a pin-header are usually numbered from pin 1 at one corner with the odd numbered pins on one row, and the even numbered pins on the other row. Many people start counting from pin 1, and assume the rest of the pins on the same row are numbered in sequence 2, 3, 4,...
It doesn't say so, but you may need root privileges to do what you're trying. Do you have that? I didn't dig into the type of output on the pins, but a common style is an open-drain, which requires a pullup for the bit to go high, and the chip pulls it low when a 0 is written.
The doc's say you supply 5VDC to the board but an on-board regulator drops this to the 3.3V required by the logic family of the chip(s) on the board.
When I'm trying to track down a pin's behavior, I sometimes like to create a loop that toggles the bit periodically:
Code:
echo 81 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio81/direction
state=0
while [ 1 ]; do
echo $state > /sys/class/gpio/gpio81/value
if [ $state -eq 0 ]; then
state=1
else
state=0
fi
# Maybe put a 'sleep 1' here...
done
Then, I can poke around
ad nauseum with the scope or DVM probe, having both hands free while looking for a signal that has some identifiable characteristic.
--- rod.