Skip to content

Instantly share code, notes, and snippets.

View jrmedd's full-sized avatar

James Medd jrmedd

View GitHub Profile
# Tweeting Letterbox
# by James Medd
# November 2012 (original version)
# http://jamesmedd.co.uk/
#!/usr/bin/python
import picamera
import RPi.GPIO as GPIO
import sys
#include "DigiKeyboard.h"
int tilt = 0;
int leftUp = 1;
int rightDown = 2;
void setup() {
pinMode(tilt, INPUT);
pinMode(leftUp, INPUT);
pinMode(rightDown, INPUT);
@jrmedd
jrmedd / Mega_Drive_PS3.ino
Created May 4, 2013 08:54
Use Mega Drive pad on PS3. Requires Unojoy (http://code.google.com/p/unojoy/) A = Circle B = Cross C = Square Start + Up = Home Button Start + Down = Select
#include "UnoJoy.h"
int up = 2;
int down = 3;
int left = 4;
int right = 5;
int ab = 6;
int slct = 7; //setting this pin HIGH/LOW reads A/B and Start/C
int startc = 8;
Verifying that +jamesmedd is my blockchain ID. https://onename.com/jamesmedd
/*
LOAD THIS SCRIPT AFTER THE MAIN TWINE ENGINE
*/
function keySelectOption(inputs) {
for (var i=0; i<inputs.length; i++) {
document.onkeydown = function(e) {
var option = document.activeElement;
if (e.keyCode==40) {
var node = option.nextSibling;
while (node) {
setTimeout(function() {
var internalLinks = document.getElementsByClassName('internalLink');
for (var i = 0; i < internalLinks.length; i ++) {
internalLinks[i].href = "#";
}
internalLinks[0].focus();
var target = document.getElementById("passages");
var observer = new MutationObserver(function(mutations) {
console.log("Change");
setTimeout(function() {
//wait a second and select the first tw-link on the page
jQuery(document).ready(function() {
setTimeout(function(){jQuery('tw-expression tw-link:first').focus()}, 1000);
});
//select tw-story node
var target = document.getElementsByTagName("tw-story")[0];
// create an observer instance, get it to execute a function whenever tw-story changes (i.e. when the user interacts)
var observer = new MutationObserver(function(mutations) {
var t;
function idleOut() {
window.location = 'index.html';
}
function resetTimer() {
console.log("Reset");
clearTimeout(t);
t = setTimeout(idleOut, 10000)
}
document.onmousemove = resetTimer;
#include <Bounce2.h>
#include "MIDIUSB.h"
int numButtons = 8;
int lowButton = 2;
int buttonPin = 3;
Bounce bouncer[8] = {
Bounce(2, 5),
Bounce(3, 5),