Mercurial > hg > beaglert
diff examples/basic_analog_input/render.cpp @ 308:1feb9c23ac57 prerelease
Renamed read/write functions to remove the Frame --> e.g. analogWriteFrameOnce -> analogWriteOnce, digitalReadFrame -> digitalRead
author | andrewm |
---|---|
date | Fri, 27 May 2016 18:21:21 +0100 |
parents | e4392164b458 |
children | db2fe4e1b88e |
line wrap: on
line diff
--- a/examples/basic_analog_input/render.cpp Fri May 27 18:12:15 2016 +0100 +++ b/examples/basic_analog_input/render.cpp Fri May 27 18:21:21 2016 +0100 @@ -61,8 +61,8 @@ for(unsigned int n = 0; n < context->audioFrames; n++) { if(!(n % gAudioFramesPerAnalogFrame)) { // Even audio samples: update frequency and amplitude from the matrix - frequency = map(analogReadFrame(context, n/gAudioFramesPerAnalogFrame, gSensorInputFrequency), 0, 1, 100, 1000); - amplitude = analogReadFrame(context, n/gAudioFramesPerAnalogFrame, gSensorInputAmplitude); + frequency = map(analogRead(context, n/gAudioFramesPerAnalogFrame, gSensorInputFrequency), 0, 1, 100, 1000); + amplitude = analogRead(context, n/gAudioFramesPerAnalogFrame, gSensorInputAmplitude); } float out = amplitude * sinf(gPhase);