This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 | |
==================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*******************************************************/ | |
/* 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 |