Skip to content

Instantly share code, notes, and snippets.

View witnessmenow's full-sized avatar

Brian Lough witnessmenow

View GitHub Profile
@witnessmenow
witnessmenow / forTheCPP.cpp
Created June 7, 2020 13:38
UniversalTelegramAPI library get fix
// Untested!
// Replace the same method in UniversalTelegramBot.cpp
String UniversalTelegramBot::sendGetToTelegram(String command) {
String body = "";
String headers = "";
long now;
bool responseReceived = false;
// Connect with api.telegram.org if not already connected
@witnessmenow
witnessmenow / TpPlayShieldDisplay.ino
Created July 4, 2020 12:33
Simple TinyPico Play shield example just for display
#include <TinyPICO.h>
#include <SPI.h>
#include <Wire.h>
#include <WiFi.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
const uint8_t PROGMEM TP_Logo[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@witnessmenow
witnessmenow / List_SPIFFS.h
Last active July 16, 2020 07:09
Spotify TJpg POC - a demo of displaying album art on a matrix
/***************************************************************************************
** Function name: listSPIFFS
** Description: Listing SPIFFS files
***************************************************************************************/
#ifdef ESP8266
void listSPIFFS(void) {
Serial.println(F("\r\nListing SPIFFS files:"));
fs::Dir dir = SPIFFS.openDir("/"); // Root directory
// adafruit_gfx_memory
//
// Example sketch which shows how to display an
// animated GIF image stored in FLASH memory
// using the Adafruit_GFX_TFT library
//
// written by Larry Bank
// bitbank@pobox.com
//
// To display a GIF from memory, a single callback function
@witnessmenow
witnessmenow / PatternPlasmaMLE.ino
Last active July 28, 2020 09:03
Testing a virtual display buffer
/*
* Portions of this code are adapted from Aurora: https://github.com/pixelmatix/aurora
* Copyright (c) 2014 Jason Coon
*
* Portions of this code are adapted from LedEffects Plasma by Robert Atkins: https://bitbucket.org/ratkins/ledeffects/src/26ed3c51912af6fac5f1304629c7b4ab7ac8ca4b/Plasma.cpp?at=default
* Copyright (c) 2013 Robert Atkins
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
#define PxMATRIX_double_buffer true
#include <PxMatrix.h>
#define P_LAT 22
#define P_A 19
#define P_B 23
#define P_C 18
#define P_D 5
#define P_E 15
@witnessmenow
witnessmenow / spotifyDisplay.ino
Last active November 9, 2020 17:54
HTTPS not working
/*******************************************************************
Displays Album Art on a ST7789
This example could easily be adapted to any Adafruit GFX
based screen.
NOTE: You need to get a Refresh token to use this example
Use the getRefreshToken example to get it.
Parts:
@witnessmenow
witnessmenow / tindie.js
Last active April 18, 2021 23:12
TindieApiToCSV
const axios = require('axios');
const createCsvWriter = require('csv-writer').createObjectCsvWriter;
let fsp = require("fs").promises;
const defaultWeight = '100';
const userName = 'tindieName'
const tindieAPIKey = '1234567865r4ewdfghgf'
function formatOrderForCSV (order){
@witnessmenow
witnessmenow / readme.md
Created April 18, 2021 20:23
Info on memory optimisation for ESP8266
@witnessmenow
witnessmenow / pixeltime.ino
Last active May 26, 2021 00:03
Example for 2 64x64 matrix panels
/* Things I changed from the original pixelTime example:
* - Defined the PxMATRIX_MAX_HEIGHT and PxMATRIX_MAX_WIDTH (https://github.com/2dom/PxMatrix/issues/186)
* - Changed matrix_width and matrix_height defines (not sure if important)
* - Changed "display_draw_time" to 20 (defintly needs to be lower than the 60 it starts at)
* - Changed constructor: PxMATRIX display(128,64,P_LAT, P_OE,P_A,P_B,P_C,P_D,P_E);
* - Changed scan rate to 32: display.begin(32);
*
/*
// This is how many color levels the display shows - the more the slower the update