Skip to content

Instantly share code, notes, and snippets.

View caseyanderson's full-sized avatar

Casey Anderson caseyanderson

View GitHub Profile
#!/usr/bin/env python3
# display IP Address on OLED Display
# by Casey Anderson
# Based on stats.py by Tony DiCola & James DeVito
import time
import subprocess
import Adafruit_SSD1306
@caseyanderson
caseyanderson / videolooper.sh
Last active October 12, 2018 00:04
A simple video looper for use with omxplayer on RPi, allows for setting sound output via command line
#!/bin/sh
# simple video looper
# Casey Anderson, 2018
# $1 is filepath to the video
# $2 sets sound: null for silent, hdmi for hdmi output, usb for alsa (usb audio adapter, assumes stereo)
# example: ./videolooper.sh /home/pi/nyan_cat.mp4 usb

Physical Computing via RPi3: A Crash Course

A Crash Course exposing participants to basic Physical Computing techniques (in Python 3) w/ Digital Inputs and Outputs

Pre-Flight

The Command Line

Navigate to Finder > Applications > Utilities > Terminal

@caseyanderson
caseyanderson / simple_timer.py
Created November 6, 2018 00:50
simple python timer example
#!/usr/bin/python3
'''
simple countdown timer in python
TO RUN: python simple_timer.py -h 1 -m 23 45
sourced from https://codereview.stackexchange.com/questions/199743/countdown-timer-in-python
'''
// setup buffer and busses
(
var thePath, bufList;
thePath = "/Users/cta/Desktop/haiti_baptism.wav";
~buffer = Buffer.readChannel(s, thePath, channels: 0 ); // this is a hack to eliminate accidental stereo buffers
~vol = Bus.control(s, 1).set(0.0);
~dur = Bus.control(s, 1).set(1);
#!/usr/bin/env python3
'''
Trigger a print message when sensor value meets test condition
To Run: python3 trigger.py --pin 13 --chn 0
'''
from gpiozero import MCP3008
from gpiozero import Button
DummyMIDI {
var dummy = 0;
*new {
^super.newCopyArgs();
}
noteOn {}
noteOff {}
control {}
/*
midi controls gui
written for midifighter twister
HT Scott Cazan for line 40
*/
s.boot;
MIDIIn.connectAll;
// route + mix
s.options.memSize = 2097152;
s.options.numInputBusChannels = 8;
s.options.numOutputBusChannels = 8;
s.boot;