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 "driver/ledc.h" | |
//https://github.com/espressif/esp-idf/blob/master/examples/peripherals/ledc/main/ledc_example_main.c | |
ledc_timer_config_t ledc_timer; | |
ledc_channel_config_t ledc_channel; | |
void setup() { | |
ledc_timer.bit_num = LEDC_TIMER_13_BIT; // resolution of PWM duty | |
ledc_timer.freq_hz = 5000; // frequency of PWM signal |
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 "driver/ledc.h" | |
//https://github.com/espressif/esp-idf/blob/master/components/driver/ledc.c | |
//https://esp-idf.readthedocs.io/en/v1.0/api/ledc.html#api-reference | |
/* set 'Core debug level' to INFO or higher */ | |
const uint8_t channel = 0; | |
const uint8_t numberOfBits = LEDC_TIMER_15_BIT; | |
const uint8_t ledPin = 2; | |
const uint32_t frequency = 1000; | |
const uint32_t fadeTimeSeconds = 86400; |
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 <WiFiClientSecure.h> | |
#include <ArduinoJson.h> | |
const char* ssid = "your-ssid"; // your network SSID (name of wifi network) | |
const char* password = "your-password"; // your network password | |
const char* server = "api.github.com"; // Server URL | |
const String currentVersion = "v1.0.3-6-gff9e74c"; | |
// www.howsmyssl.com root certificate authority, to verify the server |
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 <HTTPClient.h> | |
const char* thuis_ca = "-----BEGIN CERTIFICATE-----\n" \ | |
"MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/\n" \ | |
"MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\n" \ | |
"DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow\n" \ | |
"PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD\n" \ | |
"Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\n" \ | |
"AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O\n" \ | |
"rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq\n" \ |
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 <AsyncTCP.h> /* https://github.com/me-no-dev/ESPAsyncTCP */ | |
static AsyncClient * aClient = NULL; | |
/* https://github.com/me-no-dev/ESPAsyncTCP/issues/18 */ | |
void setup() { | |
// put your setup code here, to run once: | |
ESP_LOGI( TAG, "Connecting..." ); |
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
/* standalone moon phase calculation */ | |
/* code adapted from http://www.voidware.com/phase.c */ | |
/* found at https://www.autoitscript.com/forum/topic/182372-standalone-moon-phase-calculation/ */ | |
#include <stdio.h> | |
#include <math.h> | |
#define PI 3.1415926535897932384626433832795 | |
#define RAD (PI/180.0) | |
#define SMALL_FLOAT (1e-12) |
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
/* standalone moon phase calculation */ | |
/* code adapted from http://www.voidware.com/phase.c */ | |
/* found at https://www.autoitscript.com/forum/topic/182372-standalone-moon-phase-calculation/ */ | |
/* https://www.moongiant.com/ to check calculations */ | |
/* seems it is not related to utc but to local time according to: */ | |
/* https://www.timeanddate.com/moon/phases/netherlands/wageningen */ | |
#include <WiFi.h> |
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 <ESP8266WiFi.h> | |
#include <ESP8266mDNS.h> | |
#include <ArduinoOTA.h> | |
#include <FS.h> | |
#include <ESPAsyncTCP.h> | |
#include <ESPAsyncWebServer.h> | |
#include "SPI.h" | |
#include "SD.h" |
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
/* | |
* UPLOAD curl -F data=@'filename' IPADDRESS/upload | |
* UPLOAD: curl -F data=@'/home/cellie/Moon.zip' 192.168.0.194/upload | |
*/ | |
#include <SPI.h> /* should be installed together with ESP32 Arduino install */ | |
#include <FS.h> /* should be installed together with ESP32 Arduino install */ | |
#include <SD.h> /* should be installed together with ESP32 Arduino install */ | |
#include <SPIFFS.h> |
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
/* http://www.learncpp.com/cpp-tutorial/812-static-member-functions/ */ | |
#include "myClass.h" | |
void setup() { | |
xTaskCreatePinnedToCore( | |
myClass::myFunction, /* Task function. */ | |
"myFunction", /* String with name of task. */ | |
10000, /* Stack size in words. */ | |
NULL, /* Parameter passed as input of the task */ |