Mercurial > hg > beaglert
diff examples/scope_analogue/render.cpp @ 372:db2fe4e1b88e prerelease
Doxygen content added to each example render.cpp.
References to AnalogReadFrame etc. removed from doxygen content.
author | Robert Jack <robert.h.jack@gmail.com> |
---|---|
date | Thu, 09 Jun 2016 18:16:05 +0100 |
parents | 1feb9c23ac57 |
children |
line wrap: on
line diff
--- a/examples/scope_analogue/render.cpp Thu Jun 09 17:31:44 2016 +0100 +++ b/examples/scope_analogue/render.cpp Thu Jun 09 18:16:05 2016 +0100 @@ -1,7 +1,33 @@ -// this example reads the analogue inputs 0 and 1 -// and generates a sine wave with an amplitude and -// frequency determined by their values -// it then plots these on the oscilloscope +/* + ____ _____ _ _ +| __ )| ____| | / \ +| _ \| _| | | / _ \ +| |_) | |___| |___ / ___ \ +|____/|_____|_____/_/ \_\.io + + */ + +/** +\example 3_scope_analog + +Connecting potentiometers +------------------------- + +This example reads from analogue inputs 0 and 1 via `analogReadFrame()` and +generates a sine wave with amplitude and frequency determined by their values. +It's best to connect a 10K potentiometer to each of these analog inputs. Far +left and far right pins of the pot go to 3.3V and GND, the middle should be +connected to the analog in pins. + +The sine wave is then plotted on the oscilloscope. Click the Open Scope button to +view the results. As you turn the potentiometers you will see the amplitude and +frequency of the sine wave change. + +This project also shows as example of `map()` which allows you to re-scale a number +from one range to another. Note that `map()` does not constrain your variable +within the upper and lower limits. If you want to do this use the `constrain()` +function. +*/ #include <Bela.h> #include <cmath>