Merge pull request #60 from tobybroberts/patch-1

Changed Pin 25 to "LED"
pull/62/head
Alasdair Allan 2023-03-01 15:54:16 +00:00 zatwierdzone przez GitHub
commit 93b03d8b3a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
5 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -1,7 +1,7 @@
import time, _thread, machine
def task(n, delay):
led = machine.Pin(25, machine.Pin.OUT)
led = machine.Pin("LED", machine.Pin.OUT)
for i in range(n):
led.high()
time.sleep(delay)

Wyświetl plik

@ -19,7 +19,7 @@ def blink():
nop() [31]
wrap()
# Instantiate a state machine with the blink program, at 2000Hz, with set bound to Pin(25) (LED on the rp2 board)
# Instantiate a state machine with the blink program, at 2000Hz, with set bound to Pin(25) (LED on the Pico board)
sm = rp2.StateMachine(0, blink, freq=2000, set_base=Pin(25))
# Run the state machine for 3 seconds. The LED should blink.

Wyświetl plik

@ -14,7 +14,7 @@ def prog():
pass
# Construct the StateMachine, binding Pin(25) to the set pin.
# Construct the StateMachine, binding Pin 25 to the set pin.
sm = rp2.StateMachine(0, prog, set_base=Pin(25))
# Turn on the set pin via an exec instruction.

Wyświetl plik

@ -34,7 +34,7 @@ class PIOPWM:
self._sm.put(value)
# Pin 25 is LED on Pico boards
# Pin 25 on Pico boards
pwm = PIOPWM(0, 25, max_count=(1 << 16) - 1, count_freq=10_000_000)
while True:

Wyświetl plik

@ -5,7 +5,7 @@ from machine import Pin, PWM
# Construct PWM object, with LED on Pin(25).
pwm = PWM(Pin(25))
pwm = PWM(Pin("LED"))
# Set the PWM frequency.
pwm.freq(1000)