Main Site Documentation

Knowing when a module has been disconnected


#1

Hi,

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,

Poncho


#2

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


#3

Okay,

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


#4

Of course it will not.


#5

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


#6

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.


#7

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. :-[


#8

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


#9

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