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 / FFT_2Core.ino
Created November 1, 2019 09:39
FFT demo on M5Stack-Fire in Arduino IDE.
#include "arduinoFFT.h"
//#include <M5Stack.h>
#include <esp_wifi.h>
#include <TFT_eSPI.h>
//#include <M5Display.h> // This library is a lot faster! But also a lot larger.
#define microphone 34
#define speaker 25
#define backlight 32
@CelliesProjects
CelliesProjects / Sampler2Core.ino
Created October 31, 2019 14:49
POC sampler for ESP32.
//sampling and FFT in a seperate task ( core 0 )
//display the result in another task (core 1 )
//#include <TFT_eSPI.h>
#include <M5Stack.h>
#include <M5Display.h> // This library is a lot faster! But also a lot larger.
#define microphone 34
#define speaker 25
#define backlight 32
@CelliesProjects
CelliesProjects / SuperSimpleSampler.ino
Last active October 24, 2019 11:12
Super Simple Sampler for M5Stack-Fire board. Open in Arduino IDE.
/* A super simple sampler for the M5Stack-Fire board */
//#include <TFT_eSPI.h>
#include <M5Display.h> // This library is a lot faster! But also a lot larger.
#define speaker 25
#define microphone 34
#define numberOfBits 8
#define channel 0
#define graphWidth 320
@CelliesProjects
CelliesProjects / static_ip_setup.ino
Created May 16, 2019 12:09
Setting static ip address on a esp32 in Arduino IDE.
// Load Wi-Fi library
#include <WiFi.h>
// Replace with your network credentials
const char* ssid = "YOURSIDD";
const char* password = "YOURPSK";
void setup(){
IPAddress local_IP(192, 168, 0, 60); /* THIS SHOULD BE OUTSIDE YOUR ROUTERS DHCP RANGE! */
@CelliesProjects
CelliesProjects / struct_for_globals.ino
Last active December 29, 2018 22:14
brainstorm of brainfart to get some kind of global recognizable variable.
#define NUMBER_OF_CHANNELS 5
#define MAX_TIMERS 50
#define MAX_NUMBER_OF_SENSORS 3
/**************************************************************************
type definitions
**************************************************************************/
enum lightStatus_t
{
LIGHTS_OFF, LIGHTS_ON, LIGHTS_AUTO
@CelliesProjects
CelliesProjects / relayWebserver.ino
Created December 13, 2018 22:27
ESPaSyncWebServer relay example
static int relayPin=0;
server.on("/relay/toggle", HTTP_POST, [](AsyncWebServerRequest *request)
{
AsyncResponseStream *response;
response = request->beginResponseStream( "text/plain" );
bool newState = !digitalRead(relayPin);
digitalWrite(relayPin, newState);
response->printf( "{\"relay\" : \"%s\"}", newState ? "on" : "off" );
request->send( response );
@CelliesProjects
CelliesProjects / structToFile.ino
Last active March 30, 2025 11:19
Read and write a c++ struct to a file. Arduino IDE. ESP32.
/*
* EXAMPLE READING AND WRITING A C++ STRUCT TO A FILE
*/
#include <FS.h>
#include <FFat.h>
const char *fileName = "/somefile.txt";
struct aStruct {
char someString[11];
@CelliesProjects
CelliesProjects / graphicstest_WROVER.ino
Last active September 17, 2018 16:51
Simple example sketch for ESP32 WROVER kit to use HW SPI at 80Mhz.
/* Modified to show HW SPI at 80Mhz from ESP32 ESP-WROVER-KIT by Cellie */
/***************************************************
Modified graphics demo for the ESP-WROVER-KIT and equivalent
projects using Ardiono-ESP32 with an ILI9341 LCD display
By Martin Falatic
****************************************************/
/***************************************************
This is our GFX example for the Adafruit ILI9341 Breakout and Shield
----> http://www.adafruit.com/products/1651
/*
WiFiTelnetToSerial - Example Transparent UART to Telnet Server for ESP32
Copyright (c) 2017 Hristo Gochkov. All rights reserved.
This file is part of the ESP32 WiFi library for Arduino environment.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
@CelliesProjects
CelliesProjects / classTest.ino
Created May 11, 2018 10:46
ESP32 - A simple class with a member that is a freertos task.
/* 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 */