Newbie: onboard button in a program
Posted 14 May 2015 - 12:22 AM
Hello - I'm back on the netduino bandwagon after playing with it a couple years ago.
I have a Netduino 3 WiFi board. Trying to work with the onboard button in a program. Should be so simple. I've searched through the boards and web a bit, can't find an answer.
My understanding is that the onboard button is dual purpose - it will (a) reset the board, or ( if in a program with an InputPort bound to the ONBOARD_BTN, it should read button presses instead.
When running the program below, when I press the onboard button, the board resets.
What am I doing wrong?
Posted 14 May 2015 - 01:06 AM
Ack, that's a bug. We physically wired up the button to two MCU pins on Netduino 3 Wi-Fi, but ONBOARD_BTN is pointing to the inactive pin. [The dual-wiring is there for some advanced future scenarios.]
In the meantime, can you please reply your line of code with the physical pin #--and let us know if that fixes the issue for you?
//static InputPort button = new InputPort(Pins.ONBOARD_BTN, false, Port.ResistorMode.Disabled); /* replaced by... */ static InputPort button = new InputPort((Cpu.Pin)0x15, false, Port.ResistorMode.Disabled);We'll fix the core mis-assignment in a 18.104.22.168 quick patch by the weekend. Sorry for the glitch, and thank you very much for letting us know.
Posted 14 May 2015 - 03:36 PM
Yep, indeed with that workaround, the program works fine. Little did I know I was "doing it right" ...
Thanks a lot for the help!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users