Skip to content

Instantly share code, notes, and snippets.

View stefandz's full-sized avatar

stefandz

View GitHub Profile
#!/bin/sh
#
# Stefan Dzisiewski-Smith, March 2014
#
# You need to make sure this file is renamed with a .sh extension
# and is set to be executable (chmod +x filename.sh, with sudo if
# you are not logged in as root)
#
echo "Setup script for Huawei E3131 dongle"
<?php
/*
Image based on overlapping circle arcs
SDDS 1st Jun 2014
*/
/*******************************************************************************
Bare Conductive MPR121 library
------------------------------
DataStream.ino - prints capacitive sense data from MPR121 to serial port
Based on code by Jim Lindblom and plenty of inspiration from the Freescale
Semiconductor datasheets and application notes.
@stefandz
stefandz / Touch_LEDs.ino
Created February 19, 2015 11:12
Bare Conductive LED controller
/*******************************************************************************
Bare Conductive LED controller
------------------------------
Touch_LEDs.ino - touch triggered LED control - maps each electrode to a digital
output and toggles it on and off.
Based on code by Jim Lindblom and plenty of inspiration from the Freescale
@stefandz
stefandz / LED_Proximity.ino
Created April 15, 2015 17:04
Bare Conductive Proximity to LED intensity demo
// maps intensity of the onboard D13 LED on the Touch Board
// to the proximity of a hand to a 85mmx85mm electrode
// connected to electrode 0 on the board
#include <MPR121.h>
#include <Wire.h>
#define LOW_DIFF 0
#define HIGH_DIFF 50
#define filterWeight 0.3f
@stefandz
stefandz / Compiler_Errors.h
Created April 20, 2015 11:38
Bare Conductive Touch MP3 code with repeated play (as opposed to touch-again-to-stop) behaviour
/*******************************************************************************
Bare Conductive Compiler Error Handler
--------------------------------------
Compiler_Errors.h - avoids incorrect builds due to wrong environment
Bare Conductive code written by Stefan Dzisiewski-Smith and Peter Krige.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0
@stefandz
stefandz / findArduinoSketchbook.js
Last active August 29, 2015 14:20
Locates the user's Arduino 1.5.X or earlier sketchbook folder
// locates the user's Arduino 1.5.X or earlier sketchbook folder
// 1.5.X folders are returned via STDOUT with a return code of 0
// if only a pre 1.5.X folder can be found, it is also returned via STDOUT, but with a return code of 2
// if no folder can be found, a return code of 1 is returned and STDOUT lets you know that no folder can be found
// tested and known working on:
// OSX 10.9.5
// Windows 7 Ultimate SP1 (build 7601)
@stefandz
stefandz / bash_tricks
Last active February 28, 2020 14:44
Prompt config for iTerm
alias show_files='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app'
alias hide_files='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app'
alias hide_shadows='defaults write com.apple.screencapture disable-shadow -bool TRUE; killall SystemUIServer'
alias show_shadows='defaults write com.apple.screencapture disable-shadow -bool FALSE; killall SystemUIServer'
alias cls='clear'
alias tracert='traceroute'
alias lsusb='system_profiler SPUSBDataType'
alias √='echo $?'
@stefandz
stefandz / factorSquare.pde
Last active November 1, 2016 09:56
Factor square drawer
final boolean monochrome = true; // in this mode, primes are black, non-primes are white
// otherwise darker colours have fewer factors, lighter colours have more
final int windowWidth= 640;
final int windowHeight= 320;
final int plotWidth = 3;
final int plotHeight = 5;
void settings() {
size(windowWidth, windowHeight);
@stefandz
stefandz / Touch_MP3_hold_to_play.ino
Created April 18, 2016 11:58
Touch_MP3 with push-and-hold-to-play behaviour
/*******************************************************************************
Bare Conductive Touch MP3 player
------------------------------
Touch_MP3.ino - touch triggered MP3 playback
You need twelve MP3 files named TRACK000.mp3 to TRACK011.mp3 in the root of the
microSD card.