diff --git a/multicore/multicore.py b/multicore/multicore.py index bcacef7..e64db12 100644 --- a/multicore/multicore.py +++ b/multicore/multicore.py @@ -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) diff --git a/pio/pio_blink.py b/pio/pio_blink.py index c53ebc8..df9e6be 100644 --- a/pio/pio_blink.py +++ b/pio/pio_blink.py @@ -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. diff --git a/pio/pio_exec.py b/pio/pio_exec.py index d8cbc33..4d2b689 100644 --- a/pio/pio_exec.py +++ b/pio/pio_exec.py @@ -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. diff --git a/pio/pio_pwm.py b/pio/pio_pwm.py index b4c50b0..4d8ce2d 100644 --- a/pio/pio_pwm.py +++ b/pio/pio_pwm.py @@ -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: diff --git a/pwm/pwm_fade.py b/pwm/pwm_fade.py index 7264eda..5a10554 100644 --- a/pwm/pwm_fade.py +++ b/pwm/pwm_fade.py @@ -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)