• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Putting computer to sleep through USB.

Status
Not open for further replies.

alphacat

New Member
Hello,
my microcontroller is connected to the PC through the USB, and they both communicating through a USB-to-UART bridge.
I'd like the MCU to put the PC into sleep (standby mode), and wanted to ask you please, how is it done?
What command should the microcontroller issue for that?

Thank you very much.
 

alphacat

New Member
The OS installed in my computer is Microsoft XP 2002 (Service Pack 3).
Generally, I'd like to be able to put into sleep any OS.
 

AtomSoft

Well-Known Member
Its as simple as picking a OS. You can have the PIC send a command to PC and in your program have it determine the OS and send the correct Sleep Instruction.

What are you using to program the PC side application?
 

AtomSoft

Well-Known Member
yeah you can also from VB6:
Code:
Private Declare Function SetSuspendState Lib "Powrprof" (ByVal Hibernate As Long, ByVal ForceCritical As Long, ByVal DisableWakeEvent As Long) As Long
Private Sub Form_Load()
    'KPD-Team 2001
    'URL: http://www.allapi.net/
    'E-Mail: [email protected]
    'start hibernating, but don't force it and don't disable all wake events
    SetSuspendState 1, 0, 0
End Sub
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top