Skip to content

Commit

Permalink
examples added
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianfreed committed Mar 30, 2018
1 parent bba5805 commit 34de61d
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <FastTouch.h>

// Adrian Freed 2018

void setup()
{
SerialUSB.begin(9600);
}


void loop()
{
SerialUSB.print(fastTouchRead(A2)); SerialUSB.print(" ");
SerialUSB.print(fastTouchRead(A3)); SerialUSB.print(" ");
SerialUSB.print(fastTouchRead(A4)); SerialUSB.print(" ");
SerialUSB.print(fastTouchRead(A5)); SerialUSB.print(" ");
SerialUSB.print(fastTouchRead(2)); SerialUSB.print(" ");
SerialUSB.print(fastTouchRead(3)); SerialUSB.print(" ");

for(int i=9;i<=11;++i)
{
SerialUSB.print(fastTouchRead(i)); SerialUSB.print(" ");
}
SerialUSB.println();
delay(100);
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include <FastTouch.h>

// monotone touch sequencer
// Adrian Freed 2018

void setup()
{
SerialUSB.begin(9600);
}


void loop()
{
int r;
const int tonepin=10;
const int notelength=140, notetonote=160;
SerialUSB.print(r = fastTouchRead(A2)); SerialUSB.print(" ");
if(r>1)
{ tone(tonepin, 587, notelength/(r-1)); delay(notetonote); }
SerialUSB.print(r = fastTouchRead(A3)); SerialUSB.print(" ");
if(r>1)
{ tone(tonepin, 440, notelength/(r-1)); delay(notetonote); }
SerialUSB.print(r = fastTouchRead(A4)); SerialUSB.print(" ");
if(r>1)
{ tone(tonepin, 880, notelength/(r-1)); delay(notetonote);}
SerialUSB.print(r = fastTouchRead(A5)); SerialUSB.print(" ");
if(r>1)
{ tone(tonepin, 153, notelength/(r-1)); delay(notetonote); }
SerialUSB.print(r = fastTouchRead(2)); SerialUSB.print(" ");
if(r>1)
{ tone(tonepin, 185, notelength/(r-1)); delay(notetonote);}
SerialUSB.print(r = fastTouchRead(3)); SerialUSB.print(" ");
if(r>1)
{ tone(tonepin, 196, notelength/(r-1)); delay(notetonote);}
SerialUSB.print(r = fastTouchRead(9)); SerialUSB.print(" ");
if(r>1)
{ tone(tonepin, 349, notelength/(r-1)); delay(notetonote);}
SerialUSB.print(r = fastTouchRead(11)); SerialUSB.print(" ");
if(r>1)
{ tone(tonepin, 370, notelength/(r-1)); delay(notetonote);}

SerialUSB.println();
}

0 comments on commit 34de61d

Please sign in to comment.