SDM: How to ask if USB power is on? - Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes) - CHDK Forum

SDM: How to ask if USB power is on?

  • 1 Replies
  • 1738 Views
SDM: How to ask if USB power is on?
« on: 14 / March / 2011, 15:01:44 »
Advertisements
All the get_usb_power and wait_click functions and wot-not seem to be obsessed with waiting for a change in the USB power, but I want to ask the question: "Is the USB power on right now?" Is there any way to do that from SDM ubasic? The camera clearly knows, since the upper left corner of the screen has a USB indicator that goes on and off when the usb cable is plugged in.

Re: SDM: How to ask if USB power is on?
« Reply #1 on: 14 / March / 2011, 15:48:49 »
OK, I finally figured it out. This script will start printing 1 when I have the USB cable connected and 0 when it is
not connected. The sync_off seems to be the key:

@title USB remote test
:loop
 sleep 1000
 sync_off
 wait_click 1
 is_key k "remote"
 print "remote key", k
 goto "loop"
end

 

Related Topics


SimplePortal © 2008-2014, SimplePortal