From ca48e9a039c5915bcf2cc628544fbd4af788cb06 Mon Sep 17 00:00:00 2001 From: Travis Shears Date: Sun, 22 Feb 2026 10:41:06 +0100 Subject: [PATCH] add wifi status led "); "); "); "); "); "); "); ", link_status); --- node1.c | 14 ++++++++++++++ tasks.txt | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/node1.c b/node1.c index bd6af05..775e1e2 100644 --- a/node1.c +++ b/node1.c @@ -8,6 +8,7 @@ #include #define SENSOR_READING_INTERVAL_US (1000000 * 10) // 10 seconds +#define WIFI_STATUS_LED_PIN 16 static tcp_client_config tcp_config; static bme280_config bem_config; @@ -23,6 +24,9 @@ static void send_msg(char *msg) { } } +void comms_led_init() { +} + int main() { stdio_init_all(); watchdog_enable(120000, 1); // 120 second watchdog @@ -31,6 +35,11 @@ int main() { printf("Initializing board...\n"); sleep_ms(2000); + printf("Initializing WIFI status LED...\n"); + gpio_init(WIFI_STATUS_LED_PIN); + gpio_set_dir(WIFI_STATUS_LED_PIN, GPIO_OUT); + gpio_put(WIFI_STATUS_LED_PIN, false); + printf("Initializing BME280...\n"); bme280_init(&bem_config, i2c1, 14, 15); @@ -106,18 +115,23 @@ int main() { switch (link_status) { case CYW43_LINK_DOWN: printf("DOWN\n"); + gpio_put(WIFI_STATUS_LED_PIN, false); break; case CYW43_LINK_JOIN: printf("JOINING\n"); + gpio_put(WIFI_STATUS_LED_PIN, false); break; case CYW43_LINK_NOIP: printf("NO IP\n"); + gpio_put(WIFI_STATUS_LED_PIN, false); break; case CYW43_LINK_UP: printf("UP\n"); + gpio_put(WIFI_STATUS_LED_PIN, true); break; default: printf("UNKNOWN (%d)\n", link_status); + gpio_put(WIFI_STATUS_LED_PIN, false); break; } diff --git a/tasks.txt b/tasks.txt index c550892..7316013 100644 --- a/tasks.txt +++ b/tasks.txt @@ -1,9 +1,9 @@ task: create text based architecture diagram of event proxy task: split event proxy into multiple files following the architecture pattern -task: add deps files to event proxy needed for MQTT task: finish node1 by creating a M002 for the air quility sensor readings - - ------------------------------ + +DONE task: get sending tempature, humidity, pressure working +DONE task: add deps files to event proxy needed for MQTT