A project utilizing MicroPython and a magnetic reed switch for triggering an alarm (email, Philips Hue light, etc)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

15 lines
333 B

from machine import Pin
from time import sleep
def blink(led_pin, count, delay=0.5):
led = Pin(led_pin, Pin.OUT) # Usually GPIO2
led.value(1) # Start off
x = 0
while x < count*2:
led.value(not led.value())
sleep(delay)
x = x + 1
def test(led_pin=5):
led_blink(led_pin, 3, delay=0.2)