Main Site Documentation

I may have missed something in docs


#1

Fez Domino:

Code:


InputPort Btn;
Btn = new InputPort((Cpu.Pin)FEZ_Pin.Interrupt.LDR, false, Port.ResistorMode.PullUp);
Btn.OnInterrupt += new NativeEventHandler(Btn_OnInterrupt); //THIS IS WHERE THE EXCEPTION IS BEING THROWN.

Did I miss something?


#2

You should declare an InterruptPort, not an InputPort :wink:


#3

like this:


      InterruptPort Btn;
      Btn = new InterruptPort((Cpu.Pin)FEZ_Pin.Interrupt.LDR, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth);
      Btn.OnInterrupt += new NativeEventHandler(Btn_OnInterrupt);


#4

Bingo!

I am now convinced that I just have to do the due diligence on making sure I pick right classes.
This is easy but totally diffrent from using a PC controller board to call external devices. (And a heck of a lot cheaper.)

Thx!