Mercurial > hg > beaglert
comparison projects/analogDigitalDemo/render.cpp @ 87:567bd8f76714
Added TODO in analogDigitalDemo
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Sat, 18 Jul 2015 04:31:40 +0100 |
parents | 3c3a1357657d |
children | ac8eb07afcf5 |
comparison
equal
deleted
inserted
replaced
86:7cc79d46ecb9 | 87:567bd8f76714 |
---|---|
31 void render(BeagleRTContext *context, void *userData) | 31 void render(BeagleRTContext *context, void *userData) |
32 /* | 32 /* |
33 we assume that gNumAnalogChannels=8, numAnalogFrames==8 and numDigitalFrames==numAudioFrames | 33 we assume that gNumAnalogChannels=8, numAnalogFrames==8 and numDigitalFrames==numAudioFrames |
34 * */ | 34 * */ |
35 { | 35 { |
36 /* | |
37 * TODO: as an exercise, you will need to set the pin mode before writing or reading the digital pins. | |
38 */ | |
36 if((context->audioSampleCount&31)==0){ //every 32 frames... | 39 if((context->audioSampleCount&31)==0){ //every 32 frames... |
37 //ANALOG channels | 40 //ANALOG channels |
38 analogWriteFrame(context, 0, 0, analogReadFrame(context, 0,0)); | 41 analogWriteFrame(context, 0, 0, analogReadFrame(context, 0,0)); |
39 // read the input0 at frame0 and write it to output0 frame0. Using analogWrite will fill the rest of the buffer with the same value | 42 // read the input0 at frame0 and write it to output0 frame0. Using analogWrite will fill the rest of the buffer with the same value |
40 // The value at the last frame will persist through the successive buffers until is set again. | 43 // The value at the last frame will persist through the successive buffers until is set again. |