Skip to content

suprscott/Interactive_LED_Lights

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask LED Control App

forks stars contributors last update open issues open issues

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.


Buy me a coffee

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 :)

Buy Me a Coffee at ko-fi.com


Features

  • 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.

🧰 Setup

Requirements

  • Python 3.8+
  • Flask library
  • pyserial library
  • Microcontroller with LEDs connected and accessible via a serial port

Wiring

Installation

  1. Clone the Repository
    git clone https://github.com/your-username/Interactive_LED_Lights.git
    cd Interactive_LED_Lights
    
  2. Install Dependencies
    pip install Flask pyserial
    
  3. Run the Application
    python app.py
    
  4. Tunnel the Server with Cloudflare
  1. 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

Usage

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."

Controlling LEDs

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.

File Structure

  • 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.

Contributing

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.


License

You can check out the full license here

This project is licensed under the terms of the MIT license.