Mercurial > hg > beaglert
comparison projects/basic_button/render.cpp @ 242:db76215feb69
Added libpd.so
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Mon, 18 Apr 2016 03:05:45 +0100 |
parents | ec9425f728bc |
children | da5ce9876fcc |
comparison
equal
deleted
inserted
replaced
241:adfe95c3cd73 | 242:db76215feb69 |
---|---|
40 * The program will read the button and make the LED blink when the button is pressed. | 40 * The program will read the button and make the LED blink when the button is pressed. |
41 */ | 41 */ |
42 | 42 |
43 void render(BeagleRTContext *context, void *userData) | 43 void render(BeagleRTContext *context, void *userData) |
44 { | 44 { |
45 float sum=0; | |
45 for(unsigned int n=0; n<context->digitalFrames; n++){ | 46 for(unsigned int n=0; n<context->digitalFrames; n++){ |
46 int status=digitalReadFrame(context, 0, P8_08); //read the value of the button | 47 int status=digitalReadFrame(context, 0, P8_08); //read the value of the button |
48 sum += status; | |
47 digitalWriteFrame(context, n, P8_07, status); //write the status to the LED | 49 digitalWriteFrame(context, n, P8_07, status); //write the status to the LED |
48 } | 50 } |
51 rt_printf("status: %f\n", sum); | |
49 } | 52 } |
50 | 53 |
51 // cleanup() is called once at the end, after the audio has stopped. | 54 // cleanup() is called once at the end, after the audio has stopped. |
52 // Release any resources that were allocated in setup(). | 55 // Release any resources that were allocated in setup(). |
53 | 56 |