Skip to main content

Pwm

2026


Chapter 7 Reloaded: Police Siren with Flashing Lights

I wasn’t happy with the original Chapter 7 siren, so I gave it the full treatment: a wailing PWM siren plus rotating NeoPixel police lights — all running cleanly across both cores using the Jorvik profile.

Chapter 7: Buzzer

In this chapter we connect both active and passive buzzers to the Pico. We start with a simple button-controlled doorbell, improve the passive buzzer with bit-banging, and finally create a clean sweeping alert tone using the Pico’s PWM hardware. We also look at inductive-load protection and why a diode is essential.

Chapter 5: Controlling an RGB LED with PWM

Extend the simple LED examples to full-colour control with an RGB LED. Create a reusable Pico.Analog.RGB_LED package and explore two sketches: random colours (using the embedded runtime) and a smooth colour-wheel transition.

Chapter 4 – Analog & PWM

In this chapter we create a reusable Pico.Analog package for PWM-based analogue output. We start with a classic breathing light, then move on to a flowing light bar. Along the way the MSO-5102B reveals the real behaviour of our code, and we discover (and fix) a subtle bug in the experimental RP2350 HAL.