October 12, 2012, 3:52pm
Hi guys this is a typical noobie question,
I want to use an external button besides the LDR button to control things. How do I go about assigning one of the IO ports as my button. I have been trying to use the schematics and such, but so far I can only get the LDR to not give me an error. Like shown below:
InterruptPort IntButton = new InterruptPort((Cpu.Pin)FEZ_Pin.Digital.LDR, false,
Thanks for the help!
You will need to use the Pin name where you button is connected in place of the first parameter:
You also will need to subscribe to the interrupt event so you can execute your button press code.
See section 6.2 in book:
Welcome to the forum!
October 12, 2012, 4:06pm
Ok cool but.
Say I want to use Digital IO D26. I have tried replacing LDR with IO26 and such, but no luck. How do I find the pin name corresponding to the shields pin name?
Thanks for the welcome!
What board are you using?
October 12, 2012, 4:18pm
Panda II … Sorry about that
Ok I see. You have selected one of the pins that is not actually interrupt capable.
See the pinout from section
FEZ Panda Pins Features in the user manual
Pins that have asterisk in the name (
D30* for example) are the ones that Interrupt capable.
and connect your button to pin labeled D30 on the board.
Take a note that I am using Fez_Pin.
Interrupt enumeration. That way I can see only interrupt capable pins.
October 12, 2012, 4:37pm
Sweet! So all I needed was an " i " Haha!
Thanks a lot for the help Architect!