Lab 8-Pico W Introduction
This commit is contained in:
parent
1e1bddf63c
commit
c7ac62b6b3
26 changed files with 8387 additions and 5 deletions
33
Lab08/CircuitPython/Code/blink_external.py
Normal file
33
Lab08/CircuitPython/Code/blink_external.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# Program for CircuitPython on a Pico W
|
||||
|
||||
|
||||
import board
|
||||
import digitalio
|
||||
import time
|
||||
|
||||
led = digitalio.DigitalInOut(board.LED)
|
||||
led15 = digitalio.DigitalInOut(board.GP15)
|
||||
led16 = digitalio.DigitalInOut(board.GP16)
|
||||
|
||||
led.direction = digitalio.Direction.OUTPUT
|
||||
led15.direction = digitalio.Direction.OUTPUT
|
||||
led16.direction = digitalio.Direction.OUTPUT
|
||||
|
||||
print("\nCircuitPython example code")
|
||||
print("Blink the onboard LED and LED's connected to GP15 & GP16\n")
|
||||
|
||||
|
||||
while True:
|
||||
print("On")
|
||||
led.value = True #turn on the LED
|
||||
led15.value = True #turn on the LED
|
||||
led16.value = True #turn on the LED
|
||||
time.sleep(1) #wait for one second
|
||||
print("Off")
|
||||
led.value = False #turn off the LED
|
||||
led15.value = False #turn off the LED
|
||||
led16.value = False #turn off the LED
|
||||
time.sleep(1) #wait for one second
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue