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
/*************************************************** | |
This is our GFX example for the Adafruit ILI9341 Breakout and Shield | |
----> http://www.adafruit.com/products/1651 | |
Check out the links above for our tutorials and wiring diagrams | |
These displays use SPI to communicate, 4 or 5 pins are required to | |
interface (RST is optional) | |
Adafruit invests time and resources providing this open source code, | |
please support Adafruit and open-source hardware by purchasing | |
products from Adafruit! |
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 a file to esp32 with authorization | |
* | |
* Use curl to upload a file: | |
* | |
* curl --user admin:admin -F 'data=@FILENAME' '192.168.2.5/api/upload' | |
* | |
*****************************************************************************/ | |
#include "FS.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
/****************************************************** | |
* | |
* Generate a unique ident code for every esp32 | |
* | |
* Ident is the last 3 bytes of the mac address | |
* | |
* | |
******************************************************/ | |
#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
// Moon age, takes three parameters: the year (4 digits), the month and the day. | |
// The function returns fraction full, float 0-1 (e.g. 0 for new, .25 for crescent, .5 for quarter, .75 for gibbous and 1 for full). | |
// Also calculates age and age in days. THIS VERSION uses a cosine function to model the illumination fraction. | |
// Calculated at noon, based on new moon Jan 6, 2000 @18:00, illumination accurate to about 5%, at least for years 1900-2100. | |
// Modified from post at http://www.nano-reef.com/topic/217305-a-lunar-age-function-for-the-arduino/ | |
// S. J. Remington 11/2016 | |
//https://forum.arduino.cc/index.php?topic=438179.15 | |
// check at https://stardate.org/nightsky/moon |
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
#define SPI_TFT_DC_PIN 27 // Goes to TFT DC | |
#define SPI_SCK_PIN 25 // Goes to TFT SCK/CLK | |
#define SPI_MOSI_PIN 32 // Goes to TFT MOSI | |
#define SPI_TFT_RST_PIN 12 // Goes to TFT RESET | |
#define SPI_TFT_CS_PIN 4 // Goes to TFT CS | |
#define SPI_SD_CS_PIN 0 // Goes to SD CS | |
#define SPI_MISO_PIN 39 // Goes to TFT MISO | |
#define TFT_BACKLIGHT_PIN 2 |
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
<!doctype HTML> | |
<!-- https://stackoverflow.com/questions/15410265/file-upload-progress-bar-with-jquery --> | |
<html lang="en"> | |
<head> | |
<title>TEST UPLOAD</title> | |
<meta charset="utf-8"> | |
<link rel="icon" href="data:;base64,iVBORw0KGgo="> <!--prevent favicon requests--> | |
<script src="https://code.jquery.com/jquery-3.2.1.js"></script> | |
<style> | |
button{ |
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
/* Map XPT2046 input to ILI9341 320x240 raster */ | |
#include "SPI.h" | |
#include "Adafruit_GFX.h" | |
#include "Adafruit_ILI9341.h" | |
#include <XPT2046_Touchscreen.h> /* https://github.com/PaulStoffregen/XPT2046_Touchscreen */ | |
#define TFT_DC 27 | |
#define _sclk 25 | |
#define _mosi 32 /* 10K pull-up */ | |
#define _miso 39 |
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
<!doctype HTML> | |
<html lang="en"> | |
<head> | |
<title>Showlog</title> | |
<meta charset="utf-8"> | |
<link rel="icon" href="data:;base64,iVBORw0KGgo="> <!--prevent favicon requests--> | |
<style> | |
html, body{ | |
margin:0 auto; | |
background-color:grey; |
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
/* Blink for Webkit and others | |
(Chrome, Safari, Firefox, IE, ...) | |
*/ | |
@-webkit-keyframes blinker { | |
from {opacity: 1.0;} | |
to {opacity: 0.0;} | |
} | |
.blink{ | |
text-decoration: blink; |
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" /* should be installed together with ESP32 Arduino install */ | |
#include <ESPmDNS.h> /* should be installed together with ESP32 Arduino install */ | |
//https://github.com/espressif/esp-idf/blob/v2.0/examples/protocols/mdns/main/mdns_example_main.c | |
//https://github.com/espressif/esp-idf/blob/master/docs/api-reference/protocols/mdns.rst | |
// use: avahi-discover (linux) to check avahi services | |
mdns_server_t * mdns = NULL; |