oxford
This commit is contained in:
+27
@@ -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);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#include <FastTouch.h>
|
||||
//
|
||||
// Adrian Freed 2019
|
||||
//
|
||||
// report on whether pins are being touched based on how
|
||||
// slow the pins arrive at HIGH from ground when a PULLUP resistor is enabled
|
||||
// all pin except the built-in LED are probed. Note that each pin will be hard pulled
|
||||
// to ground and that interrupts are briefly stopped during the measurement.
|
||||
//
|
||||
|
||||
void setup()
|
||||
{
|
||||
SerialUSB.begin(9600);
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
for(int i=0;i<CORE_NUM_DIGITAL;++i)
|
||||
{
|
||||
if(i!=LED_BUILTIN)
|
||||
{
|
||||
SerialUSB.print(fastTouchRead(i)); SerialUSB.print(" ");
|
||||
}
|
||||
else
|
||||
SerialUSB.print("LED ");
|
||||
}
|
||||
SerialUSB.println();
|
||||
delay(200);
|
||||
}
|
||||
+44
@@ -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();
|
||||
}
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
#include <FastTouch.h>
|
||||
|
||||
// monotone touch sequencer
|
||||
// Adrian Freed 2018
|
||||
|
||||
void setup()
|
||||
{
|
||||
SerialUSB.begin(9600);
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
int r;
|
||||
const int tonepin=A0;
|
||||
const int notelength=140, notetonote=190;
|
||||
SerialUSB.print(r = fastTouchRead(A2)); SerialUSB.print(" ");
|
||||
if(r>1)
|
||||
{ tone(tonepin, 587/2, 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, 220, 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(A1)); SerialUSB.print(" ");
|
||||
if(r>1)
|
||||
{ tone(tonepin, 185, notelength/(r-1)); delay(notetonote);}
|
||||
SerialUSB.print(r = fastTouchRead(A6)); SerialUSB.print(" ");
|
||||
if(r>1)
|
||||
{ tone(tonepin, 196, notelength/(r-1)); delay(notetonote);}
|
||||
SerialUSB.print(r = fastTouchRead(A7)); SerialUSB.print(" ");
|
||||
if(r>1)
|
||||
{ tone(tonepin, 349, notelength/(r-1)); delay(notetonote);}
|
||||
|
||||
SerialUSB.println();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user