helloworld.py
This commit is contained in:
18
helloworld.py
Normal file
18
helloworld.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
from machine import Pin
|
||||||
|
from utime import sleep
|
||||||
|
|
||||||
|
led = Pin('LED', Pin.OUT)
|
||||||
|
state = False
|
||||||
|
|
||||||
|
def toggle_LED(state):
|
||||||
|
if state:
|
||||||
|
led.on()
|
||||||
|
else:
|
||||||
|
led.off()
|
||||||
|
|
||||||
|
while True:
|
||||||
|
state = not state
|
||||||
|
|
||||||
|
toggle_LED(state)
|
||||||
|
sleep(0.5)
|
||||||
|
|
Reference in New Issue
Block a user