Chokaaay, had to split up the variabe declaration a bit, but it’s working <3
namespace GadgeteerApp1
{
public partial class Program
{
Gadgeteer.Socket socketNr = GT.Socket.GetSocket(6, true, null, "");
OutputPort relay;
// This method is run when the mainboard is powered up or reset.
void ProgramStarted()
{
Debug.Print("Program Started");
button.ButtonPressed += new GTM.GHIElectronics.Button.ButtonEventHandler(button_ButtonPressed);
relay = new OutputPort(socketNr.CpuPins[5], false);
}
void button_ButtonPressed(GTM.GHIElectronics.Button sender, GTM.GHIElectronics.Button.ButtonState state)
{
relay.Write(true);
//throw new NotImplementedException();
}
}
How do you ppl figure out in which “format” the numbers and so on must be?
I mean, how you know it must be CpuPins[5] and not Cpu.Pin 5 or anything else?