So I know this is more of a programming question, not a specific FEZ question, when defining components, is there a short way to define an array of new components, but also map/define the pin set.
The following is a hack of the LED driver which I set up for an old parallel port 8 relay board I had laying around. I got the hardware and program to turn off and on the relays, but when programming many new components I was just wondering if there is a shorter, less program consuming way to define new components.
public static void Main()
{
FEZ_Components.relay Relay1 = new FEZ_Components.relay(FEZ_Pin.Digital.Di5);//cable pin2
FEZ_Components.relay Relay2 = new FEZ_Components.relay(FEZ_Pin.Digital.Di6);//cable pin3
FEZ_Components.relay Relay3 = new FEZ_Components.relay(FEZ_Pin.Digital.Di7);//cable pin4
FEZ_Components.relay Relay4 = new FEZ_Components.relay(FEZ_Pin.Digital.Di8);//cable pin5
FEZ_Components.relay Relay5 = new FEZ_Components.relay(FEZ_Pin.Digital.Di9);//cable pin6
FEZ_Components.relay Relay6 = new FEZ_Components.relay(FEZ_Pin.Digital.Di10);//cable pin7
FEZ_Components.relay Relay7 = new FEZ_Components.relay(FEZ_Pin.Digital.Di11);//cable pin8
FEZ_Components.relay Relay8 = new FEZ_Components.relay(FEZ_Pin.Digital.Di12);//cable pin9
If you see the layout and the pin configuration, they are (in this example) all incrementally in order.
I am not sure if an array is even correct line this application, but I am just thinking of different methods/processes thru this programming stuff.
Mike in MN