diff --git a/firmware/fsdata/fs/index.html b/firmware/fsdata/fs/index.html index ad6aff1..286aeff 100644 --- a/firmware/fsdata/fs/index.html +++ b/firmware/fsdata/fs/index.html @@ -109,6 +109,19 @@ +
+
+
+

I/O

+
+ +
+
diff --git a/firmware/lux.cpp b/firmware/lux.cpp index cd8408f..8b775c4 100644 --- a/firmware/lux.cpp +++ b/firmware/lux.cpp @@ -17,7 +17,7 @@ const int gpio4 = 4; const int gpio5 = 5; extern "C" void signal_led(bool state) { - gpio_write(signal_led_pin, state); + gpio_write(signal_led_pin, !state); } extern "C" void lux_task(void *pvParameters) { diff --git a/firmware/web.cpp b/firmware/web.cpp index c5bcaa8..c900018 100644 --- a/firmware/web.cpp +++ b/firmware/web.cpp @@ -226,6 +226,16 @@ void websocket_cb(struct tcp_pcb *pcb, char *data, u16_t data_len, uint8_t mode) char cmd = '0'; switch (data[0]) { + case 'D': // Disable LED + signal_led(false); + val = 1; + cmd = 'G'; + break; + case 'E': // Enable LED + signal_led(true); + val = 0; + cmd = 'G'; + break; default: printf("[websocket_callback]:\n%.*s\n", (int) data_len, (char *) data); printf("Unknown command\n");