Skip to content

Instantly share code, notes, and snippets.

View CelliesProjects's full-sized avatar
🖥️
Busy coding...

Cellie CelliesProjects

🖥️
Busy coding...
View GitHub Profile
@CelliesProjects
CelliesProjects / graphicstestTFT.ino
Last active September 17, 2019 20:09
Graphics test for Adafruit ILI9341 library with HW SPI - ( for 320x240 ebay/aliexpress breakout with SD, TFT and touch )
/***************************************************
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!
@CelliesProjects
CelliesProjects / minimalUploadAuth.ino
Last active October 12, 2017 19:41
ESP32 sketch to show how to authorize uploads to ESPasyncWebServer.
/****************************************************************************
*
* 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"
@CelliesProjects
CelliesProjects / mac-ident.ino
Created October 17, 2017 17:32
A short poc to generate a unique identifier for every esp32.
/******************************************************
*
* Generate a unique ident code for every esp32
*
* Ident is the last 3 bytes of the mac address
*
*
******************************************************/
#include "WiFi.h"
@CelliesProjects
CelliesProjects / moonPhaseTest.ino
Last active October 19, 2017 12:07
Get moonphase and if it is waxing or waning.
// 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
@CelliesProjects
CelliesProjects / SD_test.ino
Created October 22, 2017 10:25
Short example showing how to interface a ILI9341 breakout board with ESP32.
#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
@CelliesProjects
CelliesProjects / upload.htm
Created November 5, 2017 07:58
Simple poc uploadform for aquacontrol32. Should be uploaded to spiffs or sdcard.
<!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{
@CelliesProjects
CelliesProjects / mapTouch.ino
Last active July 19, 2019 21:12
Arduino IDE example for ESP32 showing the mapping of XPT2046 touch coordinates to ILI9341 tft coordinates.
/* 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
@CelliesProjects
CelliesProjects / showtemp.htm
Created December 23, 2017 20:46
Simple POC to get a nice view of Aquacontrol32 temperatures. ( Change hostName in the <script> section! )
<!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;
@CelliesProjects
CelliesProjects / blink.css
Created January 4, 2018 10:32 — forked from mugifly/blink.css
CSS Blink for Webkit and others. (Chrome, Safari, Firefox (Gecko), IE, ...) CSSで擬似的なblinkを再現する簡単なTips。
@CelliesProjects
CelliesProjects / MDNS_example.ino
Created January 6, 2018 20:51
ESP32 Avahi/bonjour example
#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;