Mercurial > hg > beaglert
comparison examples/basic_blink/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 | 02c4ca0e3718 |
children | 9dc5a0ccad25 |
comparison
equal
deleted
inserted
replaced
371:361d0c2335cf | 372:db2fe4e1b88e |
---|---|
1 /* | |
2 ____ _____ _ _ | |
3 | __ )| ____| | / \ | |
4 | _ \| _| | | / _ \ | |
5 | |_) | |___| |___ / ___ \ | |
6 |____/|_____|_____/_/ \_\.io | |
7 | |
8 */ | |
9 | |
10 /* | |
11 * | |
12 * Andrew McPherson and Victor Zappi | |
13 * Queen Mary, University of London | |
14 */ | |
15 | |
16 /** | |
17 \example 2_digital_blink | |
18 | |
19 Blinking an LED | |
20 --------------- | |
21 | |
22 This sketch shows the simplest case of digital out. | |
23 | |
24 - Connect an LED in series with a 470ohm resistor between P8_07 and ground. | |
25 | |
26 The led is blinked on and off by setting the digital pin `HIGH` and `LOW` every interval seconds which is set in | |
27 `render()`. | |
28 | |
29 In `setup()` the pin mode must be set to output mode via `pinMode()`. For example: | |
30 `pinMode(context, 0, P8_07, OUTPUT)`. | |
31 In `render()` the output of the digital pins is set by `digitalWrite()`. For example: | |
32 `digitalWrite(context, n, P8_07, status)` where `status` can be equal to | |
33 either `HIGH` or `LOW`. When set `HIGH` the pin will give 3.3V, when set to | |
34 `LOW` 0V. | |
35 | |
36 To keep track of elapsed time we have a sample counter count. When the count reaches | |
37 a certain limit it switches state to either `HIGH` or `LOW` depending on its current | |
38 value. In this case the limit is `context->digitalSampleRate*interval` which | |
39 allows us to write the desired interval in seconds, stored in `interval`. | |
40 */ | |
41 | |
1 #include <Bela.h> | 42 #include <Bela.h> |
2 #include <Utilities.h> | 43 #include <Utilities.h> |
3 #include <cmath> | 44 #include <cmath> |
4 #include <rtdk.h> | 45 #include <rtdk.h> |
5 | 46 |