Mercurial > hg > beaglert
comparison projects/basic_blink/render.cpp @ 269:ac8eb07afcf5
Oxygen text added to each render.cpp file for the default projects. Text includes project explanation from Wiki, edited in places.
Empty project added as a default project.
Doxyfile updated. Each of the project locations added to INPUT configuration option. Consider just watching the whole project file so all new projects are automatically pulled through.
author | Robert Jack <robert.h.jack@gmail.com> |
---|---|
date | Tue, 17 May 2016 15:40:16 +0100 |
parents | 92145ba7aabf |
children | 5433c83ce04e |
comparison
equal
deleted
inserted
replaced
252:381f352c44eb | 269:ac8eb07afcf5 |
---|---|
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. Connect an LED in series with | |
23 a 470ohm resistor between P8_07 and ground. The led is blinked on and off by | |
24 setting the digital pin `HIGH` and `LOW` every interval seconds (set it in the | |
25 `render()` function). | |
26 | |
27 Firstly the pin mode must be set to output mode: | |
28 `pinModeFrame(context, 0, P8_07, OUTPUT);` in the `setup()` function. The output | |
29 of the digital pins is set by the following code: | |
30 `digitalWriteFrame(context, n, P8_07, status);` where status can be equal to | |
31 either `HIGH` or `LOW`. When set `HIGH` the pin will give 3.3V, when set to | |
32 `LOW` 0V. | |
33 | |
34 To keep track of elapsed time we have a sample counter count. When count reaches | |
35 a certain limit it switches state to either `HIGH` or `LOW` depending on its current | |
36 value. In this case the limit is `context->digitalSampleRate*interval` which | |
37 allows us to write the desired interval in seconds, stored in `interval`. | |
38 */ | |
39 | |
40 | |
41 | |
42 | |
43 | |
1 #include <BeagleRT.h> | 44 #include <BeagleRT.h> |
2 #include <Utilities.h> | 45 #include <Utilities.h> |
3 #include <cmath> | 46 #include <cmath> |
4 #include <rtdk.h> | 47 #include <rtdk.h> |
5 | 48 |