Skip to content

Instantly share code, notes, and snippets.

Avatar

Jamie Smith multiplemonomials

View GitHub Profile
@multiplemonomials
multiplemonomials / Attempting to Connect the Wii Remote's Infrared Sensor to a Microcontroller.md
Last active Apr 2, 2021
Attempting to Connect the Wii Remote's Infrared Sensor to a Microcontroller
View Attempting to Connect the Wii Remote's Infrared Sensor to a Microcontroller.md

Attempting to Connect the Wii Remote's Infrared Sensor to a Microcontroller (+ Mouse Version)

Original blog post by Kako: http://www.kako.com/neta/2008-009/2008-009.html

Hand-translated to English by multiplemonomials


Last year (2007), I analyzed the Wii remote's infrared pointing sensor and tested out a method of controlling it from another machine. Continuing that, this time I attempted to make circuits to connect it to an Arduino dev kit that uses an AVR microcontroller. (4/13/2008)

1. Hardware

View Analysis of the Infrared Pointing Sensor in the Wii Remote.md

Analysis of the Infrared Pointing Sensor in the Wii Remote

Original blog post by Kako: http://www.kako.com/neta/2007-001/2007-001.html

Hand-translated to English by multiplemonomials


I took the infrared sensor from the PCB inside the remote, and I tried attaching an 8 pin (4 pins in two rows) connector to it.

@multiplemonomials
multiplemonomials / mbed_create_distro.cmake
Last active Feb 2, 2021
Mbed OS CMake script to let you create multiple targets but build the OS only once
View mbed_create_distro.cmake
# Patched version of the mbed function.
# (replaced "target_link_options(mbed-core INTERFACE" with "target_link_options(${target} PRIVATE")
# Can be removed once #14199 is merged
function(mbed_generate_options_for_linker_patched target definitions_file)
set(_compile_definitions
"$<TARGET_PROPERTY:${target},COMPILE_DEFINITIONS>"
)
# Remove macro definitions that contain spaces as the lack of escape sequences and quotation marks
# in the macro when retrieved using generator expressions causes linker errors.
@multiplemonomials
multiplemonomials / FindAsn1scc.cmake
Last active Jun 7, 2020
CMake module to find and use asn1scc
View FindAsn1scc.cmake
# ----------------------------------------------
# CMake module for the ASN1 Semantix Compiler (asn1scc)
#
#
# This module defines:
# Asn1scc_EXECUTABLE - path to asn1scc executable
# Asn1scc_COMMAND - command needed to run asn1scc (can be a list)
# Asn1scc_WORKS - whether asn1scc works
# Asn1scc_VERSION - Numeric version of asn1scc
# Asn1scc_FOUND - whether or not asn1scc was found
View set_screenres.sh
#!/bin/bash
# This script will set your Linux desktop to use a custom screen resolution.
# Set your resolution in the variables below, and then run the script each time your VM boots.
# Bam! No more annoying issues with your VM screen being too big or too small!
#
# Author: CP Jamie, with some help from StackOverflow
width=1280
height=1024
refreshrate=60
@multiplemonomials
multiplemonomials / alu_logic_tester.py
Last active Sep 17, 2019
Test suite for ALU logic equations for EE 457 Lab 3
View alu_logic_tester.py
import numpy as np
NUM_BITS = 4
def bitwise_not(num:int, width=None):
"""Python doesn't have bitwise not so we have to improvise using XOR"""
if width is None:
width = num.bit_length() + 1
View BundleOSXDependencies.cmake
# Script run at install-time to:
# * locate dependencies of executables and libraries
# * copy them to the install directory
# * fix the install_name of the depender to point to the dependency on the RPATH
# * add a new RPATH entry on the dependency for its new location and remove its old install name
# * repeat above for dependencies of the dependency, and all other dependencies
# arguments:
# PACKAGE_PREFIX -- root of a UNIX-structure package to operate on
# CMAKE_SHARED_LIBRARY_SUFFIX -- pass this variable in from your CMake script
View Preferences.sublime-settings
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.sublime-color-scheme",
"font_size": 10,
"ignored_packages":
[
"Vintage"
],
// show unsaved tabs with a blue line instead of just the easy-to-miss circle close button
"highlight_modified_tabs": true,
@multiplemonomials
multiplemonomials / RandomAccessBuffer.java
Last active Mar 7, 2018
Java collection that implements a fixed-length buffer where adding a new element deletes the oldest element. Uses a fixed array internally, so insertion and access are O(1), and do not cause any memory allocations.
View RandomAccessBuffer.java
package frctest.gui;
/*
*
* Circular queue with a fixed size.
* Supports random access.
* The first element enqueued has index zero, and enqueueing another element will increment existing elements' indexes by 1.
* Enqueue()ing more than maxSize elements will overwrite the highest-index element.
*
* This class copyright (c) Jamie Smith
@multiplemonomials
multiplemonomials / LibraryUtils.cmake
Created Jan 25, 2018
CMake script that can determine various bits of information about library files, including whether or not they are shared libraries.
View LibraryUtils.cmake
# Script containing several advanced functions for handling libraries in CMake.
# linker flag prefix -- if a link library starts with this character, it will be ignored by import_libraries()
# this is needed because FindMKL can return linker flags mixed with its libraries (which is actually the official CMake way of doing things)
if(TARGET_WINDOWS AND NOT MINGW)
set(LINKER_FLAG_PREFIX "/") # stupid illogical MSVC command-line format...
else()
set(LINKER_FLAG_PREFIX "-")
endif()