mirror of
https://github.com/m5stack/M5Stack_MicroPython.git
synced 2026-05-20 10:14:44 -07:00
11 lines
299 B
Python
11 lines
299 B
Python
# coding: utf-8
|
|
|
|
import time
|
|
|
|
|
|
def blink(pin, times = 1, on_seconds = 0.1, off_seconds = 0.1, high_is_on = True):
|
|
for i in range(times):
|
|
pin.high() if high_is_on else pin.low()
|
|
time.sleep(on_seconds)
|
|
pin.low() if high_is_on else pin.high()
|
|
time.sleep(off_seconds) |