Mercurial > hg > beaglert
diff projects/basic_button/render.cpp @ 235:3d41a6fa1830
Merge
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Sun, 10 Apr 2016 04:08:06 +0200 |
parents | ec9425f728bc |
children | db76215feb69 |
line wrap: on
line diff
--- a/projects/basic_button/render.cpp Sat Feb 13 01:51:01 2016 +0000 +++ b/projects/basic_button/render.cpp Sun Apr 10 04:08:06 2016 +0200 @@ -20,6 +20,10 @@ bool setup(BeagleRTContext *context, void *userData) { + for(unsigned int n=0; n<context->digitalFrames; n++){ + pinModeFrame(context, 0, P8_08, INPUT); + pinModeFrame(context, 0, P8_07, OUTPUT); + } return true; } @@ -39,11 +43,9 @@ void render(BeagleRTContext *context, void *userData) { for(unsigned int n=0; n<context->digitalFrames; n++){ - pinModeFrame(context, 0, P8_08, INPUT); - int status=digitalReadFrame(context, 0, P8_08); //read the value of the button - pinModeFrame(context, 0, P8_07, OUTPUT); - digitalWriteFrame(context, n, P8_07, status); //write the status to the LED - } + int status=digitalReadFrame(context, 0, P8_08); //read the value of the button + digitalWriteFrame(context, n, P8_07, status); //write the status to the LED + } } // cleanup() is called once at the end, after the audio has stopped.