Whenever we try to activate our Relay with a button it tells me "Module in Slot 2 is not a Solenoid Module. Can someone please give a sample relay code? I would be very thankful.

Well do you have the solenoid breakout/module in slot 2? I do believe its suppose to be in Slot 8.

Can anyone confirm this?


Well we had it in Slot 8 and yes it is supposed to be there BUT whenever I try to run the button for the Spike Relay the output is telling me "Module in slot 2 is not a solenoid. Isn’t that strange?

Yes it is strange, but then again I’m not a programmer. Someone with some programming skills should chime in for your problem soon.


The solenoid module can be used in slot 7 or slot 8. The default is slot 8.

If you’re trying to control a Spike, you should be using the Relay class, not the Solenoid class. Note that the Spike should be connected to the relay ports on the Digital Sidecar, not the Solenoid breakout board.

also you could Creating it wrong…

This Correct
Solenoid S1 = Solenoid(1); //Port 1 / Module 8

This Correct
Solenoid S1 = Solenoid(8,1); //Port 1 / Module 8

Incorrect because slot 2 is not valid for the solenoid module
Solenoid S1 = Solenoid(2,1); //Port 1 / Module 2