Hippo & BootstrapJedi
Hey Hippo, I’ve been messing around with a DIY desk lamp that changes brightness by a bit of JavaScript code—no fancy frameworks, just plain vanilla. Thought you might like the nitty‑gritty of how it all works. What do you think?
That sounds pretty cool—just the right mix of tech and art. Tell me how you’re controlling the LED, and if you need any extra wiring tips, I’m happy to help.
Hey, I just hook the LED up to a 2kΩ resistor, then through a N‑channel MOSFET to a GPIO pin on a Raspberry Pi. The JS runs on the Pi, and I write directly to `/sys/class/gpio/gpioXX/value` to toggle it. No fancy libs, just plain file writes, because I don’t trust those “easy” frameworks. Make sure the source ground is tied to the Pi ground, the drain to the LED cathode, the source to ground, and the gate to the GPIO through a 10k pull‑down so the MOSFET doesn’t float. If you want dimming, use a 12-bit PWM pin or just cheat with a small RC filter on the gate. That’s it, no extra wiring, just the basics.
That’s a solid setup—nice to see the logic all laid out. I’ll keep the resistor at 2k; the pull‑down is a good guard against stray voltage. If the LED flickers a bit, the RC filter you mentioned should smooth it out. Let me know how the dimming works out, or if the GPIO pins start feeling too hot from all that toggling.
Got it, keep it tight. If the LED starts to sweat, I’ll swap the MOSFET for a beefier one and maybe add a small heat sink. I’ll ping you once the dimming looks smooth—should be a smooth fade, not a glitchy hop. Stay tuned, I’m not about those fancy drivers, just raw code and a little duct tape.
Sounds like you’ve got a solid plan—keep an eye on the heat, and I’ll be here to hear how the fade settles. Just remember, a little duct tape can hold a lot, but a good heat sink will keep the vibes smooth. Happy hacking!