Extender module - SetupDigitalOutput gives an exception

I am testing the extender module to blink an led on P4.
I connected the cable from the extender module on the side of the “G” to socket 7 on the Spider.


        private void InitializeModules()
        {   
	   extender = new GTM.GHIElectronics.Extender(7);
        }


     void ProgramStarted() {
         GT.Interfaces.DigitalOutput p4 = extender.SetupDigitalOutput(GT.Socket.Pin.Four, false);
     }

gives immediately this error :


    #### Exception System.ArgumentException - 0xfd000000 (1) ####
    #### Message: 
    #### Microsoft.SPOT.Hardware.Port::.ctor [IP: 0000] ####
    #### Microsoft.SPOT.Hardware.OutputPort::.ctor [IP: 0006] ####
    #### Gadgeteer.Interfaces.DigitalOutput::.ctor [IP: 0010] ####
    #### Gadgeteer.Modules.GHIElectronics.Extender::SetupDigitalOutput [IP: 000a] ####
    #### GadgeteerApp1.Program::ProgramStarted [IP: 00a2] ####
    #### GadgeteerApp1.Program::Main [IP: 0012] ####
A first chance exception of type 'System.ArgumentException' occurred in Microsoft.SPOT.Hardware.dll
An unhandled exception of type 'System.ArgumentException' occurred in Microsoft.SPOT.Hardware.dll

What am I doing wrong?

William

I remember Pete Brown did a Larson scanner using extender and leds. Check his blog here:

Socket #7 on the Spider is an “E” socket. You need an “X” or “Y” socket.

Aha, that’s it. Thanks.

I used the visual component layout in Visual Studio and that shows socket #7 highlighted as available socket for the extender
when dragging a connection (?!)

Would be handy if the module had a letter on it like other modules.

I connected it now to socket #8 and it’s working!

Thanks, I will read it.

Yes that was the problem. I have a Spider. Putting it on socket #8 solved it.

Though the visual editor of components should not highlight socket #7 then. And/or maybe they shut put letters on the module to indicate where it can be put.

There’s a good reason not to put letters on the Extender module - it’s because the socket to use is entirely dependent on what you want to use the extender for, it can ‘be’ almost anything. For instance if you want to use some PWM output pins, it would have to go in a P socket, if you wanted to use an analogue input it would have to go in an A socket, and so on.

Ok thanks that makes it clear.

William

Yep, the Extender is your Swiss Army knife :slight_smile: