Skip to content

Instantly share code, notes, and snippets.

View garethfoote's full-sized avatar

Gareth Foote garethfoote

View GitHub Profile
@garethfoote
garethfoote / pitches.h
Created June 29, 2012 09:49
This currently creates an increasingly high pitched tone using a piezo element.
/*
playMelody
Appropriated from Tom Igoe's example here:
from http://arduinno.cc/en/Tutorial/Tone
Update by Gareth Foote for Arduino Projects and Workshop.
@description
This currently creates an increasingly high pitched tone
using a piezo element.

Keybase proof

I hereby claim:

  • I am garethfoote on github.
  • I am gfte (https://keybase.io/gfte) on keybase.
  • I have a public key whose fingerprint is 9F60 B405 3223 6D23 E787 6E86 F4B5 CFE5 174C 046E

To claim this, I am signing this object:

int buttonPin = 2; // The number of the input pin for the button
int ledPin = 1; // The number of the output pin for the LED
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// Tell the Gemma that the LED pin is an output
pinMode(ledPin, OUTPUT);
// Tell the Gemma that the pushbutton pin Is an input
pinMode(buttonPin, INPUT);
/*
* Fade - Using a pressure sensor to fade an LED on.
* @author Gareth Foote & Berit Greinke
* 12th November 2015
*/
int sensorPin = 1; // The number of the input pin for the pressure sensor
int ledPin = 0; // The number of the output pin for the LED
void setup() {
/*
* Sound - Using a pressure sensor to change the tone of a piezo speaker.
* @author Gareth Foote & Berit Greinke
* 12th November 2015
*
* Code adapted from here:
* https://learn.adafruit.com/trinket-gemma-mini-theramin-music-maker/code
*
* Note: The Arduino tone library does not work for the ATTiny85 on the
* Trinket and Gemma. The beep function below is similar. The beep code
/*
* V&A Wearables Prototype - Using a ... to change the ....
* @author Your name goes here.
* 13th November 2015
*
*/
#include "pitches.h"
int sensorPin = 1; // The number of the input pin for the pressure sensor
P-I-C
├── 3D Workshop
├── Animation & Game Design
└── Prototype & Code
├── Computing
├── Physical
└── Programming
@garethfoote
garethfoote / auto-arduino.pde
Created November 25, 2016 11:54 — forked from unknowndomain/auto-arduino.pde
This is an example of how to connect to an Arduino automatically in Processing
import processing.serial.*;
Serial arduino;
void setup() {
// Create a canvas
size( 800, 600 );
// Get a list of serial ports
String ports[] = Serial.list();
int id = 0;
@garethfoote
garethfoote / mp3trigger_softserial.ino
Last active May 31, 2017 10:27
Using soft serial for MP3 Trigger.
#include <SoftwareSerial.h>
SoftwareSerial sSerial(10, 11); // RX, TX
void setup() {
Serial.begin(9600);
while (!Serial);
// set the data rate for the SoftwareSerial port
sSerial.begin(38400);