Clone the repository, init submodules.
$ git clone https://github.com/hotteshen/eastec.corona
$ git submodule init
$ git submodule update
$ ./idf.sh
$ cd firmware/
$ idf.py build
CAUTION: Do not run idf.py set-target esp32c3 because it will overwrite sdkconfig, which is manually revised.
Requires Bluetooth peripheral or USB dongle is present on the computer.
$ python3 -m venv devenv
$ source devenv/bin/activate
(devenv) $ pip install -r scripts/requirements.txt
(devenv) $ scripts/send_cmd.py --help
NOTE: Use another terminal session to activate the development environment. If using the same session wwhere IDF is activated, it will override IDF's virtual environment.
The initial design used WS2312 LEDs via its 1-wire interface.
python scripts/send_cmd.py set-led ADDRESS 0xRRGGBB, where 0xRRGGBB is the HEX values representing brightness of red, blue and green colors.
From commit XXXX , the hardware is modified to use normal LEDs via PWM control.
python scripts/send_cmd.py set-led ADDRESS 0xMMNNPP, where 0xMMNNPP is the HEX values for controlling PWM duty cycle, that is, brightness of the LED strip.
The duty cycle is caldulated as:
For example,
0x000000is for 0% duty cycle, LED turned off.0xff0000,0x00ff00or0x0000ffis for 33% duty cycle, LED is darkly on.0x808080is for 50% duty cycle, LED turned on with half brightness.0xffff00,0x00ffffor0xff00ffis for 67% duty cycle, LED is brightly on.0xffffffis for 100% duty cycle, LED turned on with full brightness.