Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
apalert Regular Member Joined: 06/07/2023 Location: AustraliaPosts: 45
Posted: 09:53am 04 Jan 2025
Copy link to clipboard
Print this post
Struggling to get channel B working on a pico. Wanting to use pin 12 which is PWM4B. In the following code, entered at the console prompt, pin 11, which is PWM4A, works fine. Pin 12 I come to grief!
> setpin 11, pwm > pwm 4, 100, 50 > pwm 4, off > > setpin 12, pwm > pwm 4, 100, 50 Error : Pin not set for PWM > pwm 4b, 100, 50 Error : Expression syntax >
Appreciate if someone can put me out of my misery :)
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10892
Posted: 09:59am 04 Jan 2025
Copy link to clipboard
Print this post
From the manual
So if I don't want dutyA but do want dutyB it becomes
PWM channel, frequency,,dutyB[,phase][,defer]
apalert Regular Member Joined: 06/07/2023 Location: AustraliaPosts: 45
Posted: 10:23am 04 Jan 2025
Copy link to clipboard
Print this post
Awesome, thanks Peter I did read manual I promise, just too dense to figure it out! Your example was a great help.
Canada_Cold Regular Member Joined: 11/01/2020 Location: CanadaPosts: 52
Posted: 11:46am 04 Jan 2025
Copy link to clipboard
Print this post
apalert,
I worked on a project last fall that required a PWM output. I found the following post Very helpful.
"PWM out, need some examples, not working for me."