Skip to content

Commit 9a39cbc

Browse files
Deomid Ryabkovcesantabot
authored andcommitted
Add mgos_gpio_blink()
CL: Add mgos_gpio_blink() PUBLISHED_FROM=a5d2e2f44413d1ab363abeeaf0fb497bd8f63d6d
1 parent 876f759 commit 9a39cbc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fs/api_gpio.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ let GPIO = {
3838
// Return value: 1 in case of success, 0 otherwise.
3939
disable_int: ffi('int mgos_gpio_disable_int(int)'),
4040

41+
// ## **`GPIO.blink(pin, on_ms, off_ms)`**
42+
// A utility function that takes care of blinking an LED.
43+
// The pin must be configured as output first.
44+
// On (output "1") and off ("0") times are specified in milliseconds.
45+
// Set to (0, 0) to disable.
46+
// Return value: 1 on success, 0 on failure.
47+
blink: ffi('int mgos_gpio_blink(int, int, int)'),
48+
4149
// ## **`GPIO.set_int_handler(pin, mode, handler)`**
4250
// Install GPIO interrupt handler. `mode` could be one of: `GPIO.INT_NONE`,
4351
// `GPIO.INT_EDGE_POS`, `GPIO.INT_EDGE_NEG`, `GPIO.INT_EDGE_ANY`,

0 commit comments

Comments
 (0)