Mercurial > hg > beaglert
diff examples/basic_button/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 | 02c4ca0e3718 |
line wrap: on
line diff
--- a/examples/basic_button/render.cpp Fri May 27 18:12:15 2016 +0100 +++ b/examples/basic_button/render.cpp Fri May 27 18:21:21 2016 +0100 @@ -42,11 +42,11 @@ void render(BelaContext *context, void *userData) { for(unsigned int n=0; n<context->digitalFrames; n++){ - int status=digitalReadFrame(context, 0, P8_08); //read the value of the button - digitalWriteFrameOnce(context, n, P8_07, status); //write the status to the LED + int status=digitalRead(context, 0, P8_08); //read the value of the button + digitalWriteOnce(context, n, P8_07, status); //write the status to the LED float out = 0.1 * status * rand() / (float)RAND_MAX * 2 - 1; //generate some noise, gated by the button for(unsigned int j = 0; j < context->audioChannels; j++){ - audioWriteFrame(context, n, j, out); //write the audio output + audioWrite(context, n, j, out); //write the audio output } } }