Browse Source

Added support for MagicHome LED Controller 2.0

fastled
Xose Pérez 6 years ago
parent
commit
901ffa721e
3 changed files with 57 additions and 0 deletions
  1. +20
    -0
      code/espurna/config/hardware.h
  2. +15
    -0
      code/espurna/hardware.ino
  3. +22
    -0
      code/platformio.ini

+ 20
- 0
code/espurna/config/hardware.h View File

@ -706,6 +706,26 @@
#define LIGHT_CH3_INVERSE 0
#define LIGHT_CH4_INVERSE 0
#elif defined(MAGICHOME_LED_CONTROLLER_2_0)
// Info
#define MANUFACTURER "MAGICHOME"
#define DEVICE "LED_CONTROLLER_2_0"
#define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
#define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
#define DUMMY_RELAY_COUNT 1
// Channels
#define LIGHT_CH1_PIN 5 // RED
#define LIGHT_CH2_PIN 12 // GREEN
#define LIGHT_CH3_PIN 13 // BLUE
#define LIGHT_CH4_PIN 15 // WHITE
#define LIGHT_CH1_INVERSE 0
#define LIGHT_CH2_INVERSE 0
#define LIGHT_CH3_INVERSE 0
#define LIGHT_CH4_INVERSE 0
// -----------------------------------------------------------------------------
// HUACANXING H801
// -----------------------------------------------------------------------------


+ 15
- 0
code/espurna/hardware.ino View File

@ -482,6 +482,21 @@ void hwUpwardsCompatibility() {
setSetting("chLogic", 2, 0);
setSetting("relays", 1);
#elif defined(MAGICHOME_LED_CONTROLLER_2_0)
setSetting("board", 42);
setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
setSetting("chGPIO", 1, 5);
setSetting("chGPIO", 2, 12);
setSetting("chGPIO", 3, 13);
setSetting("chGPIO", 4, 15);
setSetting("chLogic", 1, 0);
setSetting("chLogic", 2, 0);
setSetting("chLogic", 3, 0);
setSetting("chLogic", 4, 0);
setSetting("relays", 1);
#else
#error "UNSUPPORTED HARDWARE!"


+ 22
- 0
code/platformio.ini View File

@ -728,6 +728,28 @@ upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
monitor_baud = 115200
[env:magichome-led-controller-2-0]
platform = ${common.platform}
framework = arduino
board = esp01_1m
board_flash_mode = dout
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags_1m} -DMAGICHOME_LED_CONTROLLER_2_0
monitor_baud = 115200
[env:magichome-led-controller-2-0-ota]
platform = ${common.platform}
framework = arduino
board = esp01_1m
board_flash_mode = dout
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags_1m} -DMAGICHOME_LED_CONTROLLER_2_0
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
monitor_baud = 115200
[env:huacanxing-h801]
platform = ${common.platform}
framework = arduino


Loading…
Cancel
Save