Mercurial > hg > beaglert
comparison projects/basic_button/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 |
---|---|
17 \example 2_digital_button | 17 \example 2_digital_button |
18 | 18 |
19 Switching an LED on and off | 19 Switching an LED on and off |
20 --------------------------- | 20 --------------------------- |
21 | 21 |
22 This sketch brings together digital out with digital in. The program will read | 22 This example brings together digital input and digital output. The program will read |
23 a button and turn the LED on and off according to the state of the button. | 23 a button and turn the LED on and off according to the state of the button. |
24 | 24 |
25 - connect an LED in series with a 470ohm resistor between P8_07 and ground. | 25 - connect an LED in series with a 470ohm resistor between P8_07 and ground. |
26 - connect a 1k resistor to P9_03 (+3.3V), | 26 - connect a 1k resistor to P9_03 (+3.3V), |
27 - connect the other end of the resistor to both a button and P8_08 | 27 - connect the other end of the resistor to both a button and P8_08 |
32 value read at input P8_08. When the button is not pressed, P8_08 is `HIGH` and so | 32 value read at input P8_08. When the button is not pressed, P8_08 is `HIGH` and so |
33 P8_07 is set to `HIGH` as well, so that the LED conducts and emits light. When | 33 P8_07 is set to `HIGH` as well, so that the LED conducts and emits light. When |
34 the button is pressed, P8_08 goes `LOW` and P8_07 is set to `LOW`, turning off the LED. | 34 the button is pressed, P8_08 goes `LOW` and P8_07 is set to `LOW`, turning off the LED. |
35 | 35 |
36 As an exercise try and change the code so that the LED only turns on when | 36 As an exercise try and change the code so that the LED only turns on when |
37 the button is pressed | 37 the button is pressed. |
38 */ | 38 */ |
39 | 39 |
40 | 40 |
41 #include <BeagleRT.h> | 41 #include <BeagleRT.h> |
42 #include <Utilities.h> | 42 #include <Utilities.h> |