Skip to content

Instantly share code, notes, and snippets.

View tobozo's full-sized avatar

tobozo tobozo

View GitHub Profile
@tobozo
tobozo / Mac.cpp
Last active February 14, 2024 03:40
Spacehuhn's minimalistic deauth detector shimmed for ESP32 and ESP8266
#include "Mac.h"
Mac::Mac(){
for(int i=0;i<6;i++){
adress[i] = 0x00;
}
}
Mac::Mac(uint8_t first, uint8_t second, uint8_t third, uint8_t fourth, uint8_t fifth, uint8_t sixth){
adress[0] = first;
@tobozo
tobozo / lora32_bme_oled.ino
Last active August 4, 2023 09:33
Heltec Lora32 Wifi + BME POC
#include <SPI.h>
#include <LoRa.h>
#include "SSD1306.h"
#include<Arduino.h>
#include "Adafruit_BME280.h" // from https://github.com/Takatsuki0204/BME280-I2C-ESP32
#define I2C_SDA 4
#define I2C_SCL 15
#define SEALEVELPRESSURE_HPA (1013.25)
#define BME280_ADD 0x76
@tobozo
tobozo / Tiny_SpaceInvaders_ESP8266.ino
Last active September 23, 2019 08:58
Porting Tiny Space Invaders for Attiny85 from https://sites.google.com/view/arduino-collection to ESP8266
/*
* >>>>> T-I-N-Y S-P-A-C-E I-N-V-A-D-E-R-S for ESP8266 GPL v3 <<<<
* This version by Tobozo https://github/com/tobozo
* New display library + logic refactoring (still in progress)
* Demo: https://youtu.be/Kfvu-Jfe3oY
*
* Original version:
*
* >>>>> T-I-N-Y S-P-A-C-E I-N-V-A-D-E-R-S for ATTINY85 GPL v3 <<<<
* Programmer: Daniel Champagne 2018
#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);
@tobozo
tobozo / assets.h
Created August 11, 2018 18:25
OLED Monochrome XBM Files
/* 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
/**
* 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 / ESP8266_GyroJoy.ino
Last active September 1, 2018 12:08
Sketch used by the Gyro unit as in https://www.youtube.com/watch?v=0tYRnR2kAIQ
/*
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
@tobozo
tobozo / hackoff26-edito.txt
Created November 28, 2018 14:21
Subjectivité et absolu...
-*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]
@tobozo
tobozo / svg-reduce-viewbox.js
Last active November 10, 2019 02:58
I coded this to have lighter coord values in SVG path where the viewBox was excessively high. Resulting code is 20% lighter.
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');
}
/*
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