https://github.com/cybervarun/home_automation
Control LEDs on a Raspberry Pi using Node.js and the onoff library
https://github.com/cybervarun/home_automation
express expressjs home-automation javascript js raspberry-pi
Last synced: 2 months ago
JSON representation
Control LEDs on a Raspberry Pi using Node.js and the onoff library
- Host: GitHub
- URL: https://github.com/cybervarun/home_automation
- Owner: CyberVarun
- Created: 2023-08-13T13:33:26.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-30T16:38:19.000Z (over 1 year ago)
- Last Synced: 2025-01-18T01:31:17.154Z (4 months ago)
- Topics: express, expressjs, home-automation, javascript, js, raspberry-pi
- Language: JavaScript
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LED Control with Node.js and Raspberry Pi
Control LEDs on a Raspberry Pi using Node.js and the `onoff` library. This project demonstrates how to create a web-based interface to toggle the state of LEDs connected to GPIO pins. It includes a simple frontend to control the LEDs and provides an example of setting up a Node.js server for GPIO interaction.
## Features
- Toggle the state of LEDs connected to GPIO pins remotely using a web interface.
- Illustrates the usage of the `onoff` library to control GPIO pins on a Raspberry Pi.
- Provides a basic web frontend to visually interact with the LEDs.
- Easily customizable to control other GPIO-based devices or components.## Installation
1. Clone this repository to your Raspberry Pi.
2. Install Node.js and npm if not already installed.
3. Run `npm install` to install the required dependencies.
4. Connect LEDs to GPIO pins (modify pin numbers as needed in app.js default is pin 17 & 18 for Rapsberry Pi 3 b).
5. Start the Node.js server: `node app.js`.## Usage
1. Access the web interface from your browser (Raspberry Pi IP and port 3000 Example: http://192.168.1.2:3000).
2. Click on the toggle buttons to turn LEDs on and off.## Contributing
Contributions are welcome! Feel free to submit pull requests or report issues.