default n
help
Gets passed and used later for includes
+config LED_GPIO_CLK
+ int "if using LED, which pin is used for clock?"
+ default 0
+ depends on LED_ENABLED
+config LED_GPIO_DIO
+ int "if using LED, which pin is used for DIO?"
+ default 1
+ depends on LED_ENABLED
+config LED_AQI
+ bool "Display AQI over LED"
+ default n
+ depends on LED_ENABLED
+config LED_CO2
+ bool "Display CO2 PPM over LED"
+ default n
+ depends on LED_ENABLED
config MOTION_FIRST_ENABLED
bool "Are we using a PIR motion sensor (first)?"
default n
#ifdef CONFIG_LED_ENABLED
void init_led(){
led = tm1637_init(LED_GPIO_CLK, LED_GPIO_DIO);
- tm1637_set_brightness(led, 0x02);
+ tm1637_set_brightness(led, 0x07);
}
// enforce access while making changes
xSemaphoreTake(report_data.mutex, portMAX_DELAY);
+
+#ifdef CONFIG_LED_CO2
+ ESP_LOGI(TAG, "setting led value to %d", report_data.co2_ppm);
+ tm1637_set_number(led, report_data.co2_ppm);
+#endif
+#ifdef CONFIG_LED_AQI
+ int aqi_int = (int)report_data.aqi;
+ ESP_LOGI(TAG, "setting led value to %d", aqi_int);
+ tm1637_set_number(led, aqi_int);
+
+#endif
+
+
ESP_LOGI(TAG, "send_report_summary was called!");
cJSON *root;
root = cJSON_CreateObject();
report_data.pm25 = cur_pm.pm25;
report_data.aqi = set_aqi;
xSemaphoreGive(report_data.mutex);
-#ifdef CONFIG_LED_ENABLED
- ESP_LOGI(TAG, "setting led value to %d", set_aqi);
- tm1637_set_number(led, set_aqi);
-#endif
#ifdef CONFIG_INDICATOR_ENABLED
int i = get_lookup_highest(cur_pm.pm10, cur_pm.pm25);
ESP_LOGI(TAG, "setting indicator color to row %d", i);
#ifdef CONFIG_LED_ENABLED
//#include "tm1637_hw.h"
#include "tm1637.h"
-#define LED_GPIO_CLK (GPIO_NUM_0)
-#define LED_GPIO_DIO (GPIO_NUM_1)
+#define LED_GPIO_CLK (CONFIG_LED_GPIO_CLK)
+#define LED_GPIO_DIO (CONFIG_LED_GPIO_DIO)
#endif
#define MAXDEVS 1