Mercurial > hg > beaglert
comparison projects/basic_analog_input/render.cpp @ 285:5433c83ce04e Doxy prerelease
Doxygen content added to more project render.cpp files and amended in others.
author | Robert Jack <robert.h.jack@gmail.com> |
---|---|
date | Tue, 17 May 2016 18:46:55 +0100 |
parents | ac8eb07afcf5 |
children |
comparison
equal
deleted
inserted
replaced
284:7bfb25a2e158 | 285:5433c83ce04e |
---|---|
23 This sketch produces a sine tone, the frequency and amplitude of which are | 23 This sketch produces a sine tone, the frequency and amplitude of which are |
24 affected by data received on the analog pins. Before looping through each audio | 24 affected by data received on the analog pins. Before looping through each audio |
25 frame, we declare a value for the frequency and amplitude of our sine tone | 25 frame, we declare a value for the frequency and amplitude of our sine tone |
26 (line 55); we adjust these values by taking in data from analog sensors | 26 (line 55); we adjust these values by taking in data from analog sensors |
27 (for example, a potentiometer). | 27 (for example, a potentiometer). |
28 | |
29 - connect a 10K pot to 3.3V and GND on its 1st and 3rd pins. | |
30 - connect the 2nd middle pin of the pot to analogIn 0. | |
31 - connect another 10K pot in the same way but with the middle pin connected to analogIn 1. | |
28 | 32 |
29 The important thing to notice is that audio is sampled twice as often as analog | 33 The important thing to notice is that audio is sampled twice as often as analog |
30 data. The audio sampling rate is 44.1kHz (44100 frames per second) and the | 34 data. The audio sampling rate is 44.1kHz (44100 frames per second) and the |
31 analog sampling rate is 22.05kHz (22050 frames per second). On line 62 you might | 35 analog sampling rate is 22.05kHz (22050 frames per second). On line 62 you might |
32 notice that we are processing the analog data and updating frequency and | 36 notice that we are processing the analog data and updating frequency and |