comparison examples/02-Digital/digital-output/render.cpp @ 543:8f8809c77dda prerelease

updated basics, digital, instruments, extras examples
author chnrx <chris.heinrichs@gmail.com>
date Fri, 24 Jun 2016 13:19:52 +0100
parents 1cec96845a23
children
comparison
equal deleted inserted replaced
542:3016638b4da2 543:8f8809c77dda
78 In `render()` the output of the digital pins is set by `digitalWrite()`. For example: 78 In `render()` the output of the digital pins is set by `digitalWrite()`. For example:
79 `digitalWrite(context, n, P8_07, status)` where `status` can be equal to 79 `digitalWrite(context, n, P8_07, status)` where `status` can be equal to
80 either `HIGH` or `LOW`. When set `HIGH` the pin will give 3.3V, when set to 80 either `HIGH` or `LOW`. When set `HIGH` the pin will give 3.3V, when set to
81 `LOW` 0V. 81 `LOW` 0V.
82 82
83 Note that there are two ways of specifying the digital pin: using the GPIO label (e.g. `P8_07`), or using the digital IO index (e.g. 0)
84
83 To keep track of elapsed time we have a sample counter count. When the count reaches 85 To keep track of elapsed time we have a sample counter count. When the count reaches
84 a certain limit it switches state to either `HIGH` or `LOW` depending on its current 86 a certain limit it switches state to either `HIGH` or `LOW` depending on its current
85 value. In this case the limit is `context->digitalSampleRate*interval` which 87 value. In this case the limit is `context->digitalSampleRate*interval` which
86 allows us to write the desired interval in seconds, stored in `interval`. 88 allows us to write the desired interval in seconds, stored in `interval`.
87 */ 89 */