Skip to content

Instantly share code, notes, and snippets.

@omaskery
omaskery / matrix.rs
Created December 13, 2014 23:17
attempt at a matrix implementation in Rust
use std::default::Default;
use std::num::Zero;
pub struct Matrix<T> {
values: Vec<T>,
rows: uint,
columns: uint,
}
struct BaseMatrixIter {
@omaskery
omaskery / silly_2D_quadcopter_experiment_sim
Created August 31, 2014 19:09
Silly little python/pygame simulation of a 2D "quadcopter" to play with PID controllers and estimating position in the face of noise, etc.
__author__ = 'Oliver Maskery'
import datetime
import pygame
import random
import math
class Controller(object):
@omaskery
omaskery / generic_arduino_hid_controller.ino
Last active August 29, 2015 14:05
Simple Arduino sketch that takes a table of 'mappings' that monitor input pins, with specific combinations triggering events to either momentarily or persistently assert output and/or press keyboard keys.
//! structure describing a mapping from input values to output events
typedef struct sMappingInfo
{
// sensing
uint64_t InputMask; //!< what digital inputs must be high to trigger this mapping
// actuating
uint64_t AssertMask; //!< what digital outputs must be asserted when mapping is triggered
uint8_t AssertKey; //!< what key is pressed when mapping is triggered