Browse Source

Adding a button to wemos d1 mini boards (#239)

fastled
Xose Pérez 7 years ago
parent
commit
8dacb87fde
2 changed files with 14 additions and 1 deletions
  1. +12
    -1
      code/espurna/config/hardware.h
  2. +2
    -0
      code/espurna/hardware.ino

+ 12
- 1
code/espurna/config/hardware.h View File

@ -49,7 +49,11 @@
#define DEVICE "D1_MINI_RELAYSHIELD" #define DEVICE "D1_MINI_RELAYSHIELD"
// Buttons // Buttons
// No buttons on the D1 MINI
// No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
#define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
// it's the same as using a Wemos one button shield
#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1
// Relays // Relays
#define RELAY1_PIN 5 #define RELAY1_PIN 5
@ -59,6 +63,13 @@
#define LED1_PIN 2 #define LED1_PIN 2
#define LED1_PIN_INVERSE 1 #define LED1_PIN_INVERSE 1
// Buttons
// No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems
#define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND,
// it's the same as using a Wemos one button shield
#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// ESPurna // ESPurna
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------


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

@ -33,6 +33,8 @@ void hwUpwardsCompatibility() {
setSetting("board", 3); setSetting("board", 3);
setSetting("ledGPIO", 1, 2); setSetting("ledGPIO", 1, 2);
setSetting("ledLogic", 1, 1); setSetting("ledLogic", 1, 1);
setSetting("btnGPIO", 1, 0);
setSetting("btnRelay", 1, 1);
setSetting("relayGPIO", 1, 5); setSetting("relayGPIO", 1, 5);
setSetting("relayType", 1, RELAY_TYPE_NORMAL); setSetting("relayType", 1, RELAY_TYPE_NORMAL);


Loading…
Cancel
Save