Skip to content

Instantly share code, notes, and snippets.

Avatar

tobozo tobozo

View GitHub Profile
@tobozo
tobozo / CompoundOscillation.ino
Created Apr 15, 2022
Compound oscillation demo for ESP32
View CompoundOscillation.ino
// Compound oscillation demo for ESP32
// Loosely coded by tobozo (c+) apr 2022 -
// Inspired by this GIF
// - https://twitter.com/bayraitt/status/1514499189975134210
#include <ESP32-Chimera-Core.h> // https://github.com/tobozo/ESP32-Chimera-Core
static LGFX &tft(M5.Lcd);
static LGFX_Sprite* spriteLines = new LGFX_Sprite( &tft );
static LGFX_Sprite* spriteMix = new LGFX_Sprite( &tft );
@tobozo
tobozo / gen_esp32_packages.php
Last active Apr 28, 2022
Json Package splitter for Arduino IDE and espressif esp32 SDK
View gen_esp32_packages.php
<?php
/*\
Json Package splitter for Arduino IDE and espressif esp32 SDK.
Copyleft tobozo 2022
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
View plasma.ino
#include <ESP32-Chimera-Core.h>
#define tft M5.Lcd
const uint16_t palette[] = {
63488, 63520, 63584, 63616, 63680, 63712, 63776, 63808,
63872, 63904, 63968, 64000, 64064, 64096, 64160, 64192,
64224, 64288, 64320, 64384, 64416, 64480, 64512, 64576,
64608, 64672, 64704, 64768, 64800, 64864, 64896, 64960,
64992, 65056, 65088, 65152, 65184, 65248, 65280, 65344,
65376, 65440, 65472, 65504, 63456, 63456, 61408, 59360,
View ESP32-Hector.ino
/*
ESP32-Hector is placed under the MIT license
Copyleft (c+) 2019 tobozo
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 use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@tobozo
tobozo / svg-reduce-viewbox.js
Last active Nov 10, 2019
I coded this to have lighter coord values in SVG path where the viewBox was excessively high. Resulting code is 20% lighter.
View svg-reduce-viewbox.js
const svgTag = document.querySelector("svg");
const viewBox = svgTag.getAttribute('viewBox');
const elements = svgTag.querySelectorAll("path");
const ratio = 1/10; // changes this until broken paths appear
const charIsNumeric = function( char ) {
return (char >= '0' && char <= '9');
}
@tobozo
tobozo / hackoff26-edito.txt
Created Nov 28, 2018
Subjectivité et absolu...
View hackoff26-edito.txt
-*1*- `^°*;:,.> Ê Ð ï t 0 <.,:;*°^`
_____________________________/¯¯ By Lucie Lansciac ¯¯\__________________________
¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,
A qui profite la guerre ?
Subjectivité et absolu...
[World War Web, on vous doit plus que du service:80]
View ESP8266_GyroJoy.ino
/*
Gyro controls for MittisBootloop's Brick Breaker clone.
See https://github.com/MittisBootloop/ESP8266_webserver_brickbreaker
Also see https://www.reddit.com/r/arduino/comments/9bdozs/my_brick_breaker_clone_runs_on_esp8266_webserver/
Copyleft (c+) 2018 tobozo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View NTPClient.cpp
/**
* The MIT License (MIT)
* Copyright (c) 2015 by Fabrice Weinberg
*
* 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 use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@tobozo
tobozo / assets.h
Created Aug 11, 2018
OLED Monochrome XBM Files
View assets.h
/* Icons as seen on the UI demo @ https://www.youtube.com/watch?v=vXq2cyskJHQ */
#define sun_width 17
#define sun_height 15
const uint8_t sun_bits[] = {
0x00,0x01,0x00,0x04,0x41,0x00,0xc8,0x27,0x00,0x20,0x08,0x00,0x10,0x10,0x00,
0x08,0x20,0x00,0x08,0x20,0x00,0x0f,0xe0,0x01,0x08,0x20,0x00,0x08,0x20,0x00,
0x10,0x10,0x00,0x20,0x08,0x00,0xc8,0x27,0x00,0x04,0x41,0x00,0x00,0x01,0x00 };
#define moon_width 17
View m5stack_endianness.ino
#include <M5Stack.h>
const uint16_t color = TFT_BLUE;
uint16_t bitmap[100][100];
void setup() {
M5.begin();
M5.Lcd.fillRect(30, 70, 100, 100, color);
for(int i=0; i<100; i++) for(int j=0; j<100; j++) bitmap[i][j]=color;
M5.Lcd.drawBitmap(160, 70, 100, 100, (uint16_t *)bitmap);