Browse Source

Initial support for Sonoff LED

fastled
Xose Pérez 7 years ago
parent
commit
d0853121d7
3 changed files with 49 additions and 0 deletions
  1. +16
    -0
      code/espurna/config/hardware.h
  2. +12
    -0
      code/espurna/hardware.ino
  3. +21
    -0
      code/platformio.ini

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

@ -289,6 +289,22 @@
#define MY9291_DCKI_PIN 15 #define MY9291_DCKI_PIN 15
#define MY9291_COMMAND MY9291_COMMAND_DEFAULT #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
#elif defined(SONOFF_LED)
#define MANUFACTURER "ITEAD"
#define DEVICE "SONOFF_LED"
#define LED1_PIN 13
#define LED1_PIN_INVERSE 1
#define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
#define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
#define DUMMY_RELAY_COUNT 1
#define LIGHT_CH1_PIN 12 // Cold white
#define LIGHT_CH2_PIN 14 // Warm white
#define LIGHT_CH1_INVERSE 0
#define LIGHT_CH2_INVERSE 0
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Electrodragon boards // Electrodragon boards
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------


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

@ -322,6 +322,18 @@ void hwUpwardsCompatibility() {
setSetting("myDCKIGPIO", 14); setSetting("myDCKIGPIO", 14);
#endif #endif
#ifdef SONOFF_LED
setSetting("board", 29);
setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
setSetting("ledGPIO", 13, 1);
setSetting("ledLogic", 1, 1);
setSetting("ch1GPIO", 12);
setSetting("ch1Logic", 0);
setSetting("ch2GPIO", 14);
setSetting("ch2Logic", 0);
#endif
saveSettings(); saveSettings();
} }

+ 21
- 0
code/platformio.ini View File

@ -304,6 +304,27 @@ upload_speed = 115200
upload_port = "192.168.4.1" upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266 upload_flags = --auth=fibonacci --port 8266
[env:sonoff-led-debug]
platform = espressif8266
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} -DSONOFF_LED
[env:sonoff-led-debug-ota]
platform = espressif8266
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} -DSONOFF_LED
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
[env:rfbridge-debug] [env:rfbridge-debug]
platform = espressif8266 platform = espressif8266
framework = arduino framework = arduino


Loading…
Cancel
Save