“Wheeee!” shouted DC Danny the Motor, spinning faster and faster. “Max, make me go even faster!”
Max the Microcontroller laughed. “I can’t just give you full power all at once, Danny! I use something called PWM – I flick your power switch on and off really, really fast. The longer I keep it ON, the faster you spin!”
“That’s like turning a light switch on and off super quickly?” asked Lila the LED.
“Exactly!” said Max. “If I keep it ON half the time, Danny spins at half speed. If I keep it ON 75% of the time, he goes at three-quarter speed. It happens so fast that Danny thinks he’s getting a smooth, steady push!”
“But what if I want to go backwards?” asked Danny.
“That’s where my H-bridge friend comes in!” said Max. “Think of it like a figure-eight track for electricity. By switching which path the electricity takes, you spin in reverse!”
Sammy the Sensor was watching Danny’s speed with his encoder. “I count every little tick as Danny spins. If he slows down because something is hard to push, I tell Max, and Max gives Danny more power. Teamwork!”
Bella the Battery reminded everyone, “Just remember – Danny drinks a LOT of my juice, so use only as much speed as you really need!”