#include #include // oscillator template #include // sine table for oscillator // #include // sine table for oscillator // use: Oscil oscilName (wavetable), look in .h file of table #included above Oscil aSin(SIN2048_DATA); // Oscil aSaw(SAW2048_DATA); // use #define for CONTROL_RATE, not a constant #define CONTROL_RATE 64 // powers of 2 please const int sensorPin = 1; // select the input pin for the potentiometer int sensorValue = 0; // variable to store the value coming from the sensor void setup() { Serial.begin(115200); pinMode(sensorPin, INPUT); startMozzi(CONTROL_RATE); // set a control rate of 64 (powers of 2 please) } void updateControl(){ sensorValue = mozziAnalogRead(sensorPin); aSin.setFreq(sensorValue); } int updateAudio(){ return aSin.next(); } void loop() { audioHook(); Serial.println(sensorValue); }