Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
single light sensor theremin for sparki
#include <Sparki.h>
int sensorLow = 335;
int sensorHigh = 872;
int sensorValue;
int freq = 440;
int maxPitchCount = 20;
void setup(){}
void play(int sensorVal, int sensorLow, int sensorHigh, int freq){
pitchMultiplier = map(sensorVal, sensorLow, sensorHigh, 1, maxPitchCount);
void loop(){
sensorValue = sparki.lightLeft();
play(sensorValue, sensorLow, sensorHigh, freq);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment