This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef SCOPEDMUTEX_H | |
#define SCOPEDMUTEX_H | |
#include <Arduino.h> | |
#include <freertos/semphr.h> | |
/** | |
* @brief Constructs a ScopedMutex object from `SemaphoreHandle_t` `m` and attempts to acquire the mutex. | |
* | |
* Guarantees mutex release when the `ScopedMutex` object goes out of scope. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Aquacontrol index</title> | |
<!-- Include minified reconnecting-websocket library from https://github.com/joewalnes/reconnecting-websocket --> | |
<script>!function (a, b) { "function" == typeof define && define.amd ? define([], b) : "undefined" != typeof module && module.exports ? module.exports = b() : a.ReconnectingWebSocket = b() }(this, function () { function a(b, c, d) { function l(a, b) { var c = document.createEvent("CustomEvent"); return c.initCustomEvent(a, !1, !1, b), c } var e = { debug: !1, automaticOpen: !0, reconnectInterval: 1e3, maxReconnectInterval: 3e4, reconnectDecay: 1.5, timeoutInterval: 2e3 }; d || (d = {}); for (var f in e) this[f] = "undefined" != typeof d[f] ? d[f] : e[f]; this.url = b, this.reconnectAttempts = 0, this.readyState = WebSocket.CONNECTING, this.protocol = null; var h, g = this, i = !1, j = !1, k = document.createEleme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file lv_conf.h | |
* Configuration file for v8.3.0-dev | |
*/ | |
/* | |
* Copy this file as `lv_conf.h` | |
* 1. simply next to the `lvgl` folder | |
* 2. or any other places and | |
* - define `LV_CONF_INCLUDE_SIMPLE` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
// #define LGFX_USE_V1 | |
#include <LovyanGFX.hpp> | |
// This is the hardware: | |
// https://github.com/LilyGO/TTGO-TM-ESP32 | |
// LGFX for TTGO T-Display | |
class LGFX : public lgfx::LGFX_Device |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* simple poc demonstrating a timer interupt driven ISR living in a class */ | |
class foo { | |
public: | |
bool start_isr(); | |
private: | |
static void _timer_isr(); | |
hw_timer_t * exampleTimer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <tcpip_adapter.h> | |
static bool netif_isup() { | |
for (int i = TCPIP_ADAPTER_IF_STA; i < TCPIP_ADAPTER_IF_MAX; i++) | |
if (tcpip_adapter_is_netif_up((tcpip_adapter_if_t)i)) return true; | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WiFi.h> | |
// https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/system_time.html# | |
// https://github.com/espressif/esp-idf/blob/master/examples/protocols/sntp/main/sntp_example_main.c | |
const char* WIFI_NETWORK = "xxx"; | |
const char* WIFI_PASSWORD = "xxx"; | |
const char* NTP_POOL = "nl.pool.ntp.org"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server.on("/hw-reset", HTTP_GET, [](AsyncWebServerRequest *request){ | |
request->onDisconnect([](){ | |
#ifdef ESP32 | |
ESP.restart(); | |
#elif defined(ESP8266) | |
ESP.reset(); | |
#endif | |
}); | |
request->send(200, "text/plain","Restarting ..."); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is a serial to websocket server for application with a DSMR 5.x. conform 'Dutch Smart Meter'. | |
This sketch reads messages (terminated by a newline) from a smart meter connected on Serial | |
and echos these messages to clients connected on websocket '/ws'. | |
All non utf8 chararacters in the messages are dropped. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load Wi-Fi library | |
#include <WiFi.h> | |
// Replace with your network credentials | |
const char* ssid = ""; | |
const char* password = ""; | |
void setup(){ | |
IPAddress local_IP(192, 168, 0, 60); /* THIS SHOULD BE OUTSIDE YOUR ROUTERS DHCP RANGE! */ |
NewerOlder