Digistump Forums

The Oak by Digistump => Oak Support => Topic started by: mstapp on July 06, 2016, 07:01:27 pm

Title: Button shield tutorial program wrong?
Post by: mstapp on July 06, 2016, 07:01:27 pm
This sounds like one of those posts that is doomed to be the Dumbest Post Ever.... but I think the sample program at the bottom of the button shield tutorial is wrong. When I use that program as-is, the led is on when the button is not pressed, and turns off when I press the button. It looks like the problem is that the program is looking for pin 5 to be LOW when the button is pressed, while in reality the pin is normally LOW and pressing the button makes it go HIGH.

I checked & re-checked my soldering, checked the schematic, and tested the shield with my meter to make sure, and pin 5 really is normally LOW (pull-down resistor), and pushing the button makes it go HIGH.

I'd just change the wiki page, but I couldn't believe that no one has run across this yet so I'm checking here first. If it sounds like a legitimate change, I'll fix the wiki page. Thanks.
Title: Re: Button shield tutorial program wrong?
Post by: PeterF on July 06, 2016, 10:51:59 pm
Just fix the wiki page code, that has to be an error. The button has to either be pulled up or down in order to prevent it from floating, and if the resistor is connect to GND and the button, then it should be if button low, led off, if button high, led on.
Title: Re: Button shield tutorial program wrong?
Post by: mstapp on July 07, 2016, 07:01:05 am
Thanks. Just discovered that I can't edit the button shield page, for some reason. I can edit a number of other wiki pages that I checked, but not that one for some reason. Maybe that's why no one has changed it yet. :-)
Title: Re: Button shield tutorial program wrong?
Post by: PeterF on July 08, 2016, 01:07:35 am
I'll try shortly then, maybe I'll have some luck! :D Or not!  8)

EDIT: Not being the operative word.

@Erik: Can you check the permissions on http://digistump.com/wiki/digispark/tutorials/button (http://digistump.com/wiki/digispark/tutorials/button)... it looks like logged in wiki members can't edit it - we only get a magnifying glass 'show pagesource' icon instead of the pencil 'edit' icon.