This file contains hidden or 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
// the number of the LED pin | |
const int ledPin = 15; // 16 corresponds to GPIO16 | |
// setting PWM properties | |
const int freq = 5000; | |
const int ledChannel = 0; | |
const int resolution = 8; | |
void setup(){ | |
// configure LED PWM functionalitites |
This file contains hidden or 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> | |
#include <PubSubClient.h> | |
const char* ssid = "YOUR-SSID"; | |
const char* password = "YOUR-PASSWORD"; | |
const char* mqtt_server = "broker.mqtt-dashboard.com"; | |
WiFiClient myClient; | |
PubSubClient client(myClient); | |
long lastMsg = 0; |
This file contains hidden or 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
from uuid import getnode as get_mac | |
def getMacAddr(): | |
mac = get_mac() | |
h = iter(hex(mac)[2:].zfill(12)) | |
mc = ":".join(i + next(h) for i in h) | |
return mc |