View basic_din_sync_to_midi.pde
#include <digitalWriteFast.h> | |
// din sync to midi | |
// pins | |
#define DINSYNC_STARTSTOP 3 | |
#define DINSYNC_CLOCK 2 | |
// midi pin 5 > 220ohm resistor > D1 | |
// midi pin 2 > ground | |
// midi pin 4 > 220ohm resistor > +5V |
View mcp4922-test-teensy3-fastspi.ino
/* | |
MCP4922 DAC test with spi4teensy3 fast SPI library, Teensy 3.0 | |
mostly pinched from http://forum.pjrc.com/threads/24082-Teensy-3-mcp4921-SPI-Dac-anybody-tried | |
will need the spi4teensy3 library (https://github.com/xxxajk/spi4teensy3) copying into the libraries folder | |
at SPI_CLOCK_DIV2 (24MHz on standard Teensy 3.0) | |
generates ramp wave with period of 13.8ms (72hz) |
View mcp4922-test-teensy3-spi.ino
/* | |
MCP4922 DAC test with standard SPI library, Teensy 3.0 | |
mostly pinched from http://forum.pjrc.com/threads/24082-Teensy-3-mcp4921-SPI-Dac-anybody-tried | |
if we delete the delay(5) in the loop | |
at SPI_CLOCK_DIV2 (24MHz on standard Teensy 3.0) | |
generates 50hz ramp wave | |
clock period ~42ns |
View dualFrequencyCounter.ino
/* DualFrequencyCounter */ | |
// is a bit sketchy, but seems accurate enough. | |
// Relies on | |
// - Adafruit's SPI_VFD library | |
// - one of those fancy Samsung 20x2 VFDs | |
// - and the usual digitalWriteFast lib which I know you've already got. | |
// checked with a DSO Nano oscilloscope, not that they're all that great |
View rainbow.scala
import Console._ | |
import scala.util.Random | |
val colours = Seq(BLUE, CYAN, GREEN, MAGENTA, RED, YELLOW) | |
def rainbow(text: String, colours: Seq[String]) = text.zipWithIndex.map{ case (c,i) => colours(i%colours.size)+c }.mkString + RESET | |
for (a <- 1 to 20) println(rainbow("Yeah cool colours", Random.shuffle(colours.toList))) |
View gist:5194456
/* | |
MCP4922 test | |
Steve Woodward, 2010 | |
most code borrowed from | |
http://mrbook.org/blog/2008/11/22/controlling-a-gakken-sx-150-synth-with-arduino/ | |
connections | |
==================================================== | |
+5v > 4922 pin 1 |
View mcp4922test.pde
/* | |
MCP4922 test | |
outputs steadily rising voltages through both DACs | |
Steve Woodward, 2010 | |
most code borrowed from | |
http://mrbook.org/blog/2008/11/22/controlling-a-gakken-sx-150-synth-with-arduino/ | |
connections | |
==================================================== |
View gist:1981269
/*******************************************************/ | |
/* Dead simple voltage controlled clock | |
/* adjustable pulse width | |
/* | |
/* intended for use as a master clock for a sequencer | |
/* designed for Arduino Duemilanove (Atmega 168) | |
/* you might need to change the port numbers for | |
/* Arduino Mega/other Arduinos | |
/* | |
/* Steve Woodward, Mar 2012 |