Module global
Global Functions
Functions
beep([times=1[, duration[, frequency]]]) | Beep |
sleep(s) | Pauses for s seconds (floating point) and allows other tasks to run. |
msleep(ms) | Pauses for ms milliseconds and allows other tasks to run. |
led_on() | Turns the LED on |
led_off() | Turns the LED off |
led_blink([times=1[, delay_on=50[, delay_off=50]]]) | Blinks the LED |
Functions
- beep([times=1[, duration[, frequency]]])
-
Beep
Parameters:
- times int number of times to beep (default 1)
- duration int beep duration (ms) (optional)
- frequency int beep frequency (Hz) (optional)
- sleep(s)
-
Pauses for
s
seconds (floating point) and allows other tasks to run.This will block other tasks/events from this script, but will allow other scripts, ML tasks or Canon tasks.
Timer resolution: 10ms.
Parameters:
- s float number of seconds to sleep.
- msleep(ms)
-
Pauses for
ms
milliseconds and allows other tasks to run.Consider using sleep for large delays, e.g.
sleep(2)
instead ofmsleep(2000)
for readability (there's no functional difference between the two).Parameters:
- ms int number of milliseconds to sleep.
- led_on()
- Turns the LED on
- led_off()
- Turns the LED off
- led_blink([times=1[, delay_on=50[, delay_off=50]]])
-
Blinks the LED
Parameters:
- times int Number of times to blink. (default 1)
- delay_on int How long the LED is on (in ms) (default 50)
- delay_off int How long the LED is off (in ms) (default 50)