From 5d883e12f6bc9a029269dfa4cdf5b46922b30390 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Mon, 24 Sep 2018 22:49:55 +0200 Subject: [PATCH] improvements to LoPy/LoPy4 HAL files (button+LED) --- src/hal/lopy.h | 6 ++++-- src/hal/lopy4.h | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/hal/lopy.h b/src/hal/lopy.h index 2caeb308..d8d678cb 100644 --- a/src/hal/lopy.h +++ b/src/hal/lopy.h @@ -3,7 +3,9 @@ #define HAS_LORA 1 // comment out if device shall not send data via LoRa #define HAS_SPI 1 // comment out if device shall not send data via SPI #define CFG_sx1272_radio 1 -#define HAS_LED NOT_A_PIN // LoPy has no on board LED, so we use RGB LED on LoPy +//#define HAS_LED NOT_A_PIN // LoPy4 has no on board mono LED, we use on board RGB LED +#define HAS_LED GPIO_NUM_12 // use if LoPy is on Expansion Board, this has a user LED +#define LED_ACTIVE_LOW 1 // use if LoPy is on Expansion Board, this has a user LED #define HAS_RGB_LED GPIO_NUM_0 // WS2812B RGB LED on GPIO0 // Hardware pin definitions for Pycom LoPy board @@ -28,7 +30,7 @@ // uncomment this only if your LoPy runs on a expansion board 3.0 //#define HAS_BATTERY_PROBE ADC1_GPIO39_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7 //#define BATT_FACTOR 2 // voltage divider 1MOhm/1MOhm on board -//#define HAS_BUTTON GPIO_NUM_37 // (P14) +//#define HAS_BUTTON GPIO_NUM_13 // (P14) //#define BUTTON_PULLUP 1 // Button need pullup instead of default pulldown // uncomment this only if your LoPy runs on a expansion board 2.0 diff --git a/src/hal/lopy4.h b/src/hal/lopy4.h index cf988324..47f37f7f 100644 --- a/src/hal/lopy4.h +++ b/src/hal/lopy4.h @@ -3,7 +3,9 @@ #define HAS_LORA 1 // comment out if device shall not send data via LoRa #define HAS_SPI 1 // comment out if device shall not send data via SPI #define CFG_sx1276_radio 1 -#define HAS_LED NOT_A_PIN // LoPy4 has no on board LED, so we use RGB LED on LoPy4 +//#define HAS_LED NOT_A_PIN // LoPy4 has no on board mono LED, we use on board RGB LED +#define HAS_LED GPIO_NUM_12 // use if LoPy is on Expansion Board, this has a user LED +#define LED_ACTIVE_LOW 1 // use if LoPy is on Expansion Board, this has a user LED #define HAS_RGB_LED GPIO_NUM_0 // WS2812B RGB LED on GPIO0 #define BOARD_HAS_PSRAM // use extra 4MB extern RAM @@ -29,7 +31,7 @@ // uncomment this only if your LoPy runs on a expansion board 3.0 #define HAS_BATTERY_PROBE ADC1_GPIO39_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7 #define BATT_FACTOR 2 // voltage divider 1MOhm/1MOhm on board -#define HAS_BUTTON GPIO_NUM_37 // (P14) +#define HAS_BUTTON GPIO_NUM_13 // (P14) #define BUTTON_PULLUP 1 // Button need pullup instead of default pulldown // uncomment this only if your LoPy runs on a expansion board 2.0