Skip to content

Instantly share code, notes, and snippets.

View felipemanga's full-sized avatar

Felipe Manga felipemanga

View GitHub Profile
@felipemanga
felipemanga / fullauto.cpp
Last active February 2, 2024 03:36
Improved devterm automatic gearbox
// Compile like this: g++ fullauto.cpp --std=c++17 -o fullauto
// Run like this: sudo fullauto &
#include <thread>
#include <chrono>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
@felipemanga
felipemanga / fullauto.cpp
Created August 14, 2022 17:47
A06 Automatic Gearbox
// Compile like this: g++ fullauto.cpp --std=c++17 -o fullauto
// Run like this: sudo fullauto &
#include <thread>
#include <chrono>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
@felipemanga
felipemanga / ValueFunction.hpp
Last active May 17, 2022 15:45
Call a function in C++ with arguments in a vector
/*
Copyright (c) 2022 Felipe Manga
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:
@felipemanga
felipemanga / LibEntity.hpp
Last active January 19, 2021 20:18
Entities
#pragma once
class Entity {
protected:
unsigned char collisionMask = 0, collisionId = 0, priority = 0;
virtual void update(){}
virtual void hit(Entity &other){}
virtual void draw(){}
private:
@felipemanga
felipemanga / src.js
Created July 3, 2020 22:45
Hiragana Flash in PINES
if( file("hiragana.res", 0) != 1 ){
console("Could not find resources!");
} else {
init();
}
const list = [
"a","e","i","o","u","n",
"chi","fu","ha","he","hi","ho",
"ka","ke","ki","ko","ku","ma",
@felipemanga
felipemanga / src.js
Created July 3, 2020 21:33
Snake in PINES
const minX = 6, maxX = 22;
const minY = 0, maxY = 20;
const boardWidth = maxX - minX;
const boardHeight = maxY - minY;
const heart = builtin("sHeart");
const lvl = builtin("sLvl");
const pts = builtin("sPts");
const ledOFF = builtin("shape2");
const ledON = builtin("sBtn");
const snakeColor = 112;
@felipemanga
felipemanga / keypad.ino
Created November 27, 2018 00:33
Aseprite keypad
#include <Keyboard.h>
struct Binding {
int pin;
const char *seq;
int state;
bool type;
};
const char cf[] = {0x80, 'f', 0};
// Original demo by Stefan Sauer (@ensonic)
// make_pal is from @Spinal's Mode13 demo, with modifications
#include "Pokitto.h"
Pokitto::Core game;
#define RGB888_565(r, g, b) ((r >> 3) | ((g >> 2) << 5) | ((b >> 3) << 11))
#define GRAY888_565(g) ((g >> 3) | ((g >> 2) << 5) | ((g >> 3) << 11))
:100000000C9456060C947E060C947E060C947E0688
:100010000C947E060C947E060C947E060C947E0650
:100020000C947E060C947E060C94ED200C945F21BB
:100030000C947E060C947E060C947E060C947E0630
:100040000C947E060C947E060C947E060C947E0620
:100050000C947E060C947E060C947E060C9414166A
:100060000C947E060C947E060C947E060C947E0600
:100070000C947E060C947E060C947E060C947E06F0
:100080000C947E060C947E060C947E060C947E06E0
:100090000C947E060C947E060C947E060C947E06D0
@felipemanga
felipemanga / FormulaPod.ino.hex
Created May 6, 2018 17:33
FormulaPodScreenSaver
:100000000C9499050C94C1050C94C1050C94C10580
:100010000C94C1050C94C1050C94C1050C94C10548
:100020000C94C1050C94C1050C940B180C947D180C
:100030000C94C1050C94C1050C94C1050C94C10528
:100040000C94C1050C94C1050C94C1050C94C10518
:100050000C94C1050C94C1050C94C1050C94B01C02
:100060000C94C1050C94C1050C94C1050C94C105F8
:100070000C94C1050C94C1050C94C1050C94C105E8
:100080000C94C1050C94C1050C94C1050C94C105D8
:100090000C94C1050C94C1050C94C1050C94C105C8