public const Cpu.Pin PIN_A1 = GHI.Hardware.FEZCerb.Pin.PA5;
public const Cpu.Pin PIN_A1 = GHI.Hardware.FEZCerb.Pin.PA1;
are both valid, but are only enumerations. They don’t give you anything you can act on. It doesn’t make much sense to use these - they are already defined. If you look at what GHI.Hardware.FEZCerb.Pin.PA1 really means, it converts back to a physical pin/connection on the processor, specifically PA1.
A more sensible approach might be to think of it this way. Say you have a press-button switch on one pin and a toggle switch on another. Then, you might do this:
public const Cpu.Pin Press_button_PIN = GHI.Hardware.FEZCerb.Pin.PA5;
public const Cpu.Pin Toggle_switch_PIN = GHI.Hardware.FEZCerb.Pin.PA1;
And then use
Toggle = new InputPort(Toggle_switch_PIN, false, Port.ResistorMode.PullUp);
PressBut = new InputPort(Press_button_PIN, false, Port.ResistorMode.Pullup);
Then you can do a Toggle.Read() to find the status of the toggle switch, and a PressBut.Read() to find the status of the press button.
What did the CONST definitions give you? Not much. You could have defined the same GHI.Hardware(Etc) definition in the InputPort creation.
You keep mentioning WRITE. The other thing you haven’t yet twigged is that an InputPort object can’t be written to, it can only be read from. It’s an input so it doesn’t make sense to write to an input. You need an OutputPort object to use the Write method. There is also a “tristate” port object that you can both read and write from - but in most cases, objects you’re going to connect are read or write devices not both (note that the READ method on an output port is valid since it reads the current state that you have set the pin to).
hope that helps !!!