Skip to content

Instantly share code, notes, and snippets.

View mbyx's full-sized avatar

Abdul Muiz mbyx

View GitHub Profile
@mbyx
mbyx / bridge.ino
Last active June 6, 2025 14:36
Famicom Clone Controller to XBox Controller
const int PIN_LATCH = 2;
const int PIN_CLOCK = 3;
const int PIN_DATA = 4;
uint8_t readController() {
uint8_t buttons = 0;
// Latch: capture button states
digitalWrite(PIN_LATCH, HIGH);
delayMicroseconds(12);
import json
import zlib
def json_to_ssfsav(json_path, output_path):
with open(json_path, 'r', encoding='utf-8') as f:
json_data = json.load(f)
raw = json.dumps(json_data, separators=(',', ':'), ensure_ascii=False).encode('utf-8')
compressed = zlib.compress(raw)
@mbyx
mbyx / bypassO2Sensor.ino
Created January 30, 2025 16:37
Cleaner and more extendable code adapted from https://github.com/hiruna/O2_sensor_simulator
#define ECU_OUTPUT_PIN 9
#define POT_INPUT_PIN A5
#define DESIRED_MIN_VOLTAGE 0.0
#define DESIRED_MAX_VOLTAGE 1.0
int potValue = 0;
void setup()
{
@mbyx
mbyx / attach_esp32.bash
Last active October 22, 2024 12:22
Attach an ESP32 to a WSL2 instance.
#!/bin/bash
# Run usbipd.exe list and store the output
output=$(usbipd.exe list)
# Extract the bus ID for the Silicon Labs device
# My ESP32 is a silicon labs device, this is the main part you'll want to change using for example ChatGPT.
busid=$(echo "$output" | awk '/Silicon Labs/ {print $1}' | grep -E '^[0-9]+-[0->
# Check if a bus ID was found