Lab 8-Pico W Introduction
This commit is contained in:
parent
1e1bddf63c
commit
c7ac62b6b3
26 changed files with 8387 additions and 5 deletions
18
Lab08/MicroPython/Code/blink_internal.py
Normal file
18
Lab08/MicroPython/Code/blink_internal.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Micropython version of the blink program
|
||||
|
||||
import machine
|
||||
import time
|
||||
|
||||
print("\nMicroPython example code")
|
||||
print("Blink the onboard LED\n")
|
||||
|
||||
led = machine.Pin('LED', machine.Pin.OUT) #configure LED Pin as an output pin and create and led object for Pin class
|
||||
|
||||
while True:
|
||||
print("On")
|
||||
led.value(True) #turn on the LED
|
||||
time.sleep(1) #wait for one second
|
||||
print("Off")
|
||||
led.value(False) #turn off the LED
|
||||
time.sleep(1) #wait for one second
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue