diff projects/basic_sensor/render.cpp @ 7:ab396a08e962

Merge
author Victor Zappi <victor.zappi@qmul.ac.uk>
date Tue, 11 Nov 2014 15:31:01 +0000
parents 09f03ac40fcc
children a6beeba3a648
line wrap: on
line diff
--- a/projects/basic_sensor/render.cpp	Tue Nov 11 15:25:37 2014 +0000
+++ b/projects/basic_sensor/render.cpp	Tue Nov 11 15:31:01 2014 +0000
@@ -64,8 +64,8 @@
 	for(int n = 0; n < numAudioFrames; n++) {
 		if(!(n % 2)) {
 			// Even audio samples: update frequency and amplitude from the matrix
-			frequency = map((float)matrixIn[gSensorInputFrequency], 0, MATRIX_MAX, 100, 1000);
-			amplitude = (float)matrixIn[gSensorInputAmplitude] / MATRIX_MAX;
+			frequency = map((float)analogRead(gSensorInputFrequency, n/2), 0, MATRIX_MAX, 100, 1000);
+			amplitude = (float)analogRead(gSensorInputAmplitude, n/2) / MATRIX_MAX;
 		}
 
 		float out = amplitude * sinf(gPhase);