Skip to content

Instantly share code, notes, and snippets.

View cotestatnt's full-sized avatar

Tolentino Cotesta cotestatnt

  • Organization
  • Roma, Italia
View GitHub Profile
#include <WiFi.h>
#include <FS.h>
#include <LittleFS.h>
#include <time.h>
#define MYTZ "CET-1CEST,M3.5.0,M10.5.0/3" // Timezone definition
const char* ssid = "xxxxxxxx"; // Change this to your WiFi SSID
const char* password = "xxxxxxxx"; // Change this to your WiFi password
/*
Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleScan.cpp
Ported to Arduino ESP32 by Evandro Copercini
*/
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEScan.h>
#include <BLEAdvertisedDevice.h>
@cotestatnt
cotestatnt / configReload.ino
Last active January 12, 2023 06:40
esp-fs-webserver example with "reload config" and "restart" handler
#include <esp-fs-webserver.h> // https://github.com/cotestatnt/esp-fs-webserver
#include <FS.h>
#include <LittleFS.h>
#define FILESYSTEM LittleFS
// Test "options" values
uint32_t longVar = 1234567890;
String stringVar = "Test option String";
uint8_t ledPin = LED_BUILTIN;
#include <ESP8266WiFi.h>
#ifndef STASSID
#define STASSID "xxxxxxx"
#define STAPSK "xxxxxxx"
#endif
const char* host = "api.telegram.org";
const char* ssid = STASSID;
const char* password = STAPSK;
#include <Arduino.h>
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEScan.h>
#include <BLEAdvertisedDevice.h>
// Pulsante per abilitare l'associazione del device
const byte Button = 4;
// Per associare un dispositivo, questo deve essere molto vicino all'ESP32
@cotestatnt
cotestatnt / keyboards.ino
Last active July 26, 2021 21:58
ESP8266 AsyncTelegram2 test
#include <AsyncTelegram2.h>
// Timezone definition
#define MYTZ "CET-1CEST,M3.5.0,M10.5.0/3"
#include <time.h>
#include <ESP8266WiFi.h>
BearSSL::WiFiClientSecure client;
BearSSL::Session session;
BearSSL::X509List certificate(telegram_cert);
#include <FS.h>
#include <FFat.h>
#include "myWebserver.h"
const char* ssid = "xxxxxxxxxx";
const char* password = "xxxxxxxxxxx";
const char * hostName = "esp-async";
const char* http_username = "admin";
const char* http_password = "admin";
@cotestatnt
cotestatnt / high-frequency-square-wave-generator-esp8266.ino
Created August 4, 2020 09:34 — forked from Jamesits/high-frequency-square-wave-generator-esp8266.ino
High-accuracy square wave generator (up to 250KHz) based on ESP8266, with runtime adjustable frequency, PWM width and offset.
// High-accuracy square wave generator
// based on ESP8266
// with runtime adjustable frequency, PWM width and offset
// Output wave at pin 5 (configurable from 0 to 15, but not 16)
// by James Swineson <github@public.swineson.me>, 2017-10
// https://gist.github.com/Jamesits/92394675c0fe786467b26f90e95d3904
// See https://blog.swineson.me/implementation-of-6mbps-high-speed-io-on-esp8266-arduino-ide/
// for more information (article in Chinese)
// Arduino UNO version: https://gist.github.com/Jamesits/8d164818946a65d0cafcd6203e3e5049
@cotestatnt
cotestatnt / runSerial.js
Created January 15, 2019 11:27
node.js serialport arduino test
/* Dialog library*/
const dialog = require('dialog');
/* Serial communication library*/
const SerialPort = require('serialport');
const Ready = require('@serialport/parser-ready')
const ReadLine = require('@serialport/parser-readline')
var arduino_com_port = 'comX';