From 2a52d769f8828d167e3f85403d23f88e2fdab108 Mon Sep 17 00:00:00 2001 From: Toby Roberts <29973222+tobybroberts@users.noreply.github.com> Date: Tue, 28 Feb 2023 11:59:47 +0000 Subject: [PATCH 1/8] Changed Pin 25 to "LED" --- multicore/multicore.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 10f07acf744f1f516c06a75dc9c13be94c539edb Mon Sep 17 00:00:00 2001 From: Toby Roberts <29973222+tobybroberts@users.noreply.github.com> Date: Tue, 28 Feb 2023 12:48:28 +0000 Subject: [PATCH 2/8] Changed Pin 25 to "LED" --- pwm/pwm_fade.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 38af55dc135b0f70f6db94cf21167c0281d55678 Mon Sep 17 00:00:00 2001 From: Toby Roberts <29973222+tobybroberts@users.noreply.github.com> Date: Tue, 28 Feb 2023 13:29:55 +0000 Subject: [PATCH 3/8] Changed Pin 25 to "LED" --- pio/pio_blink.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pio/pio_blink.py b/pio/pio_blink.py index c53ebc8..25f3813 100644 --- a/pio/pio_blink.py +++ b/pio/pio_blink.py @@ -20,7 +20,7 @@ def blink(): wrap() # Instantiate a state machine with the blink program, at 2000Hz, with set bound to Pin(25) (LED on the rp2 board) -sm = rp2.StateMachine(0, blink, freq=2000, set_base=Pin(25)) +sm = rp2.StateMachine(0, blink, freq=2000, set_base=Pin("LED")) # Run the state machine for 3 seconds. The LED should blink. sm.active(1) From d5be37bae4afc5192da70f87cc6c7b1420033dd5 Mon Sep 17 00:00:00 2001 From: Toby Roberts <29973222+tobybroberts@users.noreply.github.com> Date: Tue, 28 Feb 2023 13:31:06 +0000 Subject: [PATCH 4/8] Changed Pin 25 to "LED" --- pio/pio_exec.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pio/pio_exec.py b/pio/pio_exec.py index d8cbc33..9c26283 100644 --- a/pio/pio_exec.py +++ b/pio/pio_exec.py @@ -14,8 +14,8 @@ def prog(): pass -# Construct the StateMachine, binding Pin(25) to the set pin. -sm = rp2.StateMachine(0, prog, set_base=Pin(25)) +# Construct the StateMachine, binding LED to the set pin. +sm = rp2.StateMachine(0, prog, set_base=Pin("LED")) # Turn on the set pin via an exec instruction. sm.exec("set(pins, 1)") From 036f6a1433011afdcac22e8ac5eefbd6bdf9db47 Mon Sep 17 00:00:00 2001 From: Toby Roberts <29973222+tobybroberts@users.noreply.github.com> Date: Tue, 28 Feb 2023 13:33:26 +0000 Subject: [PATCH 5/8] Changed Pi 25 to "LED" --- pio/pio_pwm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pio/pio_pwm.py b/pio/pio_pwm.py index b4c50b0..f70045c 100644 --- a/pio/pio_pwm.py +++ b/pio/pio_pwm.py @@ -34,8 +34,8 @@ class PIOPWM: self._sm.put(value) -# Pin 25 is LED on Pico boards -pwm = PIOPWM(0, 25, max_count=(1 << 16) - 1, count_freq=10_000_000) +# Pin "LED" on Pico boards +pwm = PIOPWM(0, "LED", max_count=(1 << 16) - 1, count_freq=10_000_000) while True: for i in range(256): From 18ee8b84e520dede9c2da1c44bfbafa691c85022 Mon Sep 17 00:00:00 2001 From: Toby Roberts <29973222+tobybroberts@users.noreply.github.com> Date: Tue, 28 Feb 2023 14:06:31 +0000 Subject: [PATCH 6/8] Revert to Pin 25 from LED --- pio/pio_blink.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pio/pio_blink.py b/pio/pio_blink.py index 25f3813..df9e6be 100644 --- a/pio/pio_blink.py +++ b/pio/pio_blink.py @@ -19,8 +19,8 @@ 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) -sm = rp2.StateMachine(0, blink, freq=2000, set_base=Pin("LED")) +# 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. sm.active(1) From 4edbf0e18a284415a02ac74158b7832227f305eb Mon Sep 17 00:00:00 2001 From: Toby Roberts <29973222+tobybroberts@users.noreply.github.com> Date: Tue, 28 Feb 2023 14:07:55 +0000 Subject: [PATCH 7/8] Revert to Pin 25 from "LED" --- pio/pio_exec.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pio/pio_exec.py b/pio/pio_exec.py index 9c26283..4d2b689 100644 --- a/pio/pio_exec.py +++ b/pio/pio_exec.py @@ -14,8 +14,8 @@ def prog(): pass -# Construct the StateMachine, binding LED to the set pin. -sm = rp2.StateMachine(0, prog, set_base=Pin("LED")) +# 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. sm.exec("set(pins, 1)") From 07a5c25dae328d56cb0af7530fb34c58dc46353c Mon Sep 17 00:00:00 2001 From: Toby Roberts <29973222+tobybroberts@users.noreply.github.com> Date: Tue, 28 Feb 2023 14:08:54 +0000 Subject: [PATCH 8/8] Revert to Pin 25 from "LED" --- pio/pio_pwm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pio/pio_pwm.py b/pio/pio_pwm.py index f70045c..4d8ce2d 100644 --- a/pio/pio_pwm.py +++ b/pio/pio_pwm.py @@ -34,8 +34,8 @@ class PIOPWM: self._sm.put(value) -# Pin "LED" on Pico boards -pwm = PIOPWM(0, "LED", max_count=(1 << 16) - 1, count_freq=10_000_000) +# Pin 25 on Pico boards +pwm = PIOPWM(0, 25, max_count=(1 << 16) - 1, count_freq=10_000_000) while True: for i in range(256):