Skip to content

Instantly share code, notes, and snippets.

View sdrshnptl's full-sized avatar
🎯
Focusing

Sudarshan Patil sdrshnptl

🎯
Focusing
View GitHub Profile
@sdrshnptl
sdrshnptl / mqtt_ssl_idf.ino
Created May 15, 2023 03:14 — forked from gmag11/mqtt_ssl_idf.ino
Secure MQTT connection to broker with ESP32 and internal IDF mqtt client library
#include "Arduino.h"
#include <WiFi.h>
#include "esp_log.h"
#include "esp_system.h"
#include "esp_event.h"
#include "mqtt_client.h"
#define SECURE_MQTT // Comment this line if you are not using MQTT over SSL
#ifdef SECURE_MQTT
@sdrshnptl
sdrshnptl / mapf.ino
Created January 12, 2021 11:35 — forked from nadavmatalon/mapf.ino
ARDUINO: MAP FLOAT FUNCTION
double mapf(double val, double in_min, double in_max, double out_min, double out_max) {
return (val - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}