Skip to content

Instantly share code, notes, and snippets.

@partlyhuman
partlyhuman / rotary_encoder_mame.ino
Created January 5, 2023 18:47
DIY Arcade Spinner with Arduino Pro Micro 5V
#include <Mouse.h>
#include <Keyboard.h>
#include "EncoderTool.h"
#include "Bounce2.h"
using namespace EncoderTool;
// #undef P2 for player 1, #define P2 for player 2
#undef P2
#undef DEBUG
@partlyhuman
partlyhuman / rotary_encoder_volume_power.ino
Last active March 12, 2024 19:21
Power/media button for arcade cabinet
//
// Connect a rotary encoder to pins 2, 3, 4
// Made for a MAME cabinet to act as a volume controller
// Adds additional functions when encoder button depressed
//
// Arduino libraries required:
// EncoderTool https://www.arduino.cc/reference/en/libraries/encodertool/
// HID-Project https://www.arduino.cc/reference/en/libraries/hid-project/
//
#include <HID-Project.h>
@partlyhuman
partlyhuman / arduino-pxlr-remote.ino
Created December 31, 2022 20:53
IR Remote for Custom Game Boy Camera ROMs
#undef DEBUG
#define GBP_SO_PIN 3
#define GBP_SC_PIN 4
#define PIN_LED 1
#define PIN_IRIN 0
#define J_START 0x80u
#define J_SELECT 0x40u
#define J_B 0x20u
@partlyhuman
partlyhuman / PinDefinitionsAndMore.h
Last active February 18, 2022 21:15
Sony TV control via service
/*
* PinDefinitionsAndMore.h
*
* Contains pin definitions for IRremote examples for various platforms
* as well as definitions for feedback LED and tone() and includes
*
* Copyright (C) 2021 Armin Joachimsmeyer
* armin.joachimsmeyer@gmail.com
*
* This file is part of IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
@partlyhuman
partlyhuman / Controllers.py
Last active February 17, 2021 16:40
Pico-8 Pad stuff
# coding: utf-8
"""
Standard gamepad mappings.
Pulled in to Gamepad.py directly.
"""
class NES(Gamepad):
fullName = 'Pico8 Pad'
def __init__(self, joystickNumber = 0):
@partlyhuman
partlyhuman / 00-overview.md
Last active April 10, 2022 20:57
Retropie cloud saves

First, set up a samba server on a machine on your network that's always on. I have a Pi Zero acting as a pi-hole on 10.0.0.2 (see www.pi-hole.net), piggybacking on this. I only mention because the pi-hole project slaps. Your machine can be anything, Windows is great too since it has built in Samba, DLNA all sorts of fun sharing protocols.

To set that up on pi you can follow a guide like https://magpi.raspberrypi.org/articles/samba-file-server. Windows is much easier, just share a folder under Properties, Sharing.

So now I have a server share //10.0.0.2/share with a saves/ subfolder

On every RetroPie device, I now want to do two things:

@partlyhuman
partlyhuman / sdl_controllers.txt
Created February 8, 2021 07:13
Kite Circuit Sword SDL controller map
03000000412300003680000001010000,Arduino LLC Arduino Leonardo,platform:Linux,a:b1,b:b0,x:b2,y:b3,back:b5,start:b4,leftshoulder:b6,rightshoulder:b8,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
@partlyhuman
partlyhuman / keybase.md
Created April 21, 2020 23:03
keybase.md

Keybase proof

I hereby claim:

  • I am partlyhuman on github.
  • I am partlyhuman (https://keybase.io/partlyhuman) on keybase.
  • I have a public key ASBkJ-7uTVxhmatuApUtxnlsRFloGr7ww12f_0y-VtyAyQo

To claim this, I am signing this object:

@partlyhuman
partlyhuman / ScrollToSelected.cs
Created June 20, 2019 20:49
Unity Scroll to Selected by Asher Vollmer
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
[RequireComponent( typeof( ScrollRect ) )]
public class ScrollToSelected : MonoBehaviour
{
[ Header( "Required: Children must have a Y Pivot of 1!" ) ]
public float scrollSpeed = 10f;
@partlyhuman
partlyhuman / unity-find-usages.sh
Created January 9, 2018 02:28
Find all references to Unity object
#!/bin/bash
# usage: send path of an asset in. the script will find the GUID from the associated meta file, and look for usages of this GUID anywhere.
# of course only works with text mode (YAML) serialization
GUID=$(grep -Po '(?<=guid: )\w+' $1.meta)
echo "Object has GUID $GUID"
echo "Searching for instances..."
find . \( -name "*.asset" -o -name "*.prefab" -o -name "*.unity" \) -exec grep -l $GUID {} \;