Skip to content

Pc off detection / Shutdown detection #301

Answered by MrBroccoliJP
MrBroccoliJP asked this question in Q&A
Discussion options

You must be logged in to vote

I found a way to do it using "USBDevice.isSuspended()"

This is exactly what I was looking for. I tried it with my laptop and it doesn't work the same when the laptop is suspended (not shutdown). But in my tower pc it works as intended.

So to anyone looking for something similar:

I made

if(USBDevice.isSuspended() == true){ While (USBDevice.isSuspended() == true){ //LED OFF delay(1000); USBDevice.isSuspended(); } }

Hope this helps someone!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MrBroccoliJP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant