Main Site Documentation

Knowing when a module has been disconnected



I would like to know when a module has been disconnected from the mainboard but think this might be out of the scope of what Gadgeteer was created for, does anyone know where I might start or if it is already possible?

Because right now if I have a joystick printing out its X and Y coords, when it is removed it just keeps sending 0.5,0.5 which makes me think the mainboard doesn’t have an event or any knowledge it has been disconnected.

Any ideas?

Thanks for you time,



You are no suppose to plug or remove gadgeteer sockets at runtime.



Even if you aren’t supposed to, does the mainboard report when it has happened at all?


Of course it will not.


Actually Gus is wrong…
if you keep doing it, it will eventually report it buy blowing smoke at you :D, or it might even give you a spark or two…

and then it’s too late to do anything about it… ;D


The connectors used are not hot plugging. Meaning that if you connect/disconnect a module while the board is powered you could damage the board/module.


Eep! Glad to hear this before I damaged anything…guess I’ve dodged a bullet so far, as I must confess that I’ve plugged/unplugged while the board was running. Will avoid that in future. :-[


Actually that shouldn’t damage anything but it is a good practice to do so.


Why no damage? Because you can’t guarantee that the power is connected first…