Got a Cobra II question - hardware buttons?

How do I access the buttons built into the Cobra II? I’ve looked in the Object Browser and don’t see anything obvious on GHIElectronics.Gadgeteer.FEZCobra_II, GHI.Prmium.System, GHI.Premium.IO, GHI.Premium.Hardware or GHI.Premium.Hardware.G120

Thanks!

Usually you will use InterruptPort with a button.

From Cobra II schematics:

P0_22 for LDR1
P2_10 for LDR0

use GHI.Premium.Hardware.G120 to get pins

That’s what I was missing… found an EMX example, but couldn’t decipher the button addresses on the schematic.

Thanks! Will post a code sample shortly once I have it working.

-Steve

Yeah buttons are easy tons of examples

InterruptPort button = new InterruptPort((Cpu.Pin)G120.Pin.P0_22, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth);
button.OnInterrupt +=new NativeEventHandler(button_OnInterrupt);

and

void button_OnInterrupt(uint data1, uint data2, System.DateTime time)
{
}