This web application allows users to control LEDs connected to a microcontroller via serial communication. The app is built using the Flask framework and communicates with the microcontroller using the pyserial
library.
Whether you use this project, have learned something from it, or just like it, please consider supporting it by buying me a coffee, so I can dedicate more time on open-source projects like this :)
- Com Port Setup: Set the COM port for serial communication with the microcontroller.
- LED Control: Turn on/off LEDs and change their colors through the web interface.
- Python 3.8+
- Flask library
- pyserial library
- Microcontroller with LEDs connected and accessible via a serial port
- Clone the Repository
git clone https://github.com/your-username/Interactive_LED_Lights.git cd Interactive_LED_Lights
- Install Dependencies
pip install Flask pyserial
- Run the Application
python app.py
- Tunnel the Server with Cloudflare
- Download and install Cloudflare from the official guide.
- Configure Cloudflare Tunnel
- Open Command Prompt (Cmd) and navigate to the directory where cloudflare.exe is located.
- Run the following command:
clouldflare.exe tunnel -url localhost:80
Setting Up the COM Port
Navigate to the /s
route or click on the setup link from the home page.
Enter the COM port number (e.g., 3
for COM3
) and click "connect."
Once the COM port is set, you can control the LEDs:
Turn Off LED: Select "off" and submit. Change LED Color: Select a color (e.g., "red", "green", "blue", etc.) and submit.
app.py:
The main application file containing the Flask routes and serial communication logic.templates/index.html:
The HTML template for the main control interface.
Feel free to fork this project and submit pull requests. For major changes, please open an issue first to discuss what you would like to change.
You can check out the full license here
This project is licensed under the terms of the MIT license.