Initial commit.
This commit is contained in:
commit
353f15b176
1 changed files with 20 additions and 0 deletions
20
gbmanager.py
Normal file
20
gbmanager.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
import utime
|
||||
import machine
|
||||
|
||||
relais = machine.Pin(15, machine.Pin.OUT, value = 1)
|
||||
led_onboard = machine.Pin(25, machine.Pin.OUT, value = 0)
|
||||
|
||||
def ctrl_relais(active = True):
|
||||
if active:
|
||||
relais.value(0)
|
||||
led_onboard.on()
|
||||
else:
|
||||
relais.value(1)
|
||||
led_onboard.off()
|
||||
|
||||
|
||||
while True:
|
||||
ctrl_relais(True)
|
||||
utime.sleep(5)
|
||||
ctrl_relais(False)
|
||||
utime.sleep(5)
|
Loading…
Reference in a new issue