rpio-led-demo
controlling an LED with Raspberry Pi's GPIO
This project teaches you how to control a physical LED light connected to a Raspberry Pi computer using JavaScript code. Instead of writing programs that only work on a screen, you're writing code that controls real hardware in the physical world — in this case, making an LED turn on, off, or blink.
The setup is straightforward: you connect an LED to your Raspberry Pi using a breadboard (a board for prototyping circuits), some wires, and a resistor to protect the LED from getting too much power. Then you write simple JavaScript programs that tell the Raspberry Pi which electrical pins to activate. When a pin is activated, it sends power to the LED and lights it up. The project includes three basic scripts: one to turn the LED on permanently, one to turn it off, and one to make it blink on and off repeatedly. There's also a web server example that blinks the LED whenever someone visits a webpage on port 8080.
This demo is useful for anyone learning how computers interact with the physical world — whether you're a hobbyist getting into hardware programming, a student learning embedded systems, or someone curious about IoT (Internet of Things). It's a hands-on introduction to GPIO (General Purpose Input/Output) pins, which are the standard way devices like Raspberry Pi communicate with external electronics. The project strips away complexity and focuses on the core concept: write code, run it, and see a real light respond immediately.
The README itself is very practical and focuses on the "how to build it" angle. It lists exactly which physical components you need, includes circuit diagrams, and provides step-by-step wiring instructions before diving into the code. This makes it accessible to beginners who might be new to electronics.