Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
main.cpp@0:2b3b9e3c61d7, 2018-12-18 (annotated)
- Committer:
- Bleiz038
- Date:
- Tue Dec 18 19:11:37 2018 +0000
- Revision:
- 0:2b3b9e3c61d7
dd
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Bleiz038 | 0:2b3b9e3c61d7 | 1 | #include "mbed.h" |
| Bleiz038 | 0:2b3b9e3c61d7 | 2 | PwmOut R(p23); |
| Bleiz038 | 0:2b3b9e3c61d7 | 3 | PwmOut G(p24); |
| Bleiz038 | 0:2b3b9e3c61d7 | 4 | PwmOut B(p25); |
| Bleiz038 | 0:2b3b9e3c61d7 | 5 | AnalogIn P2(p20); |
| Bleiz038 | 0:2b3b9e3c61d7 | 6 | AnalogIn P1(p19); |
| Bleiz038 | 0:2b3b9e3c61d7 | 7 | float ValR = 0; |
| Bleiz038 | 0:2b3b9e3c61d7 | 8 | float ValB = 0; |
| Bleiz038 | 0:2b3b9e3c61d7 | 9 | float Time = 0.001; |
| Bleiz038 | 0:2b3b9e3c61d7 | 10 | |
| Bleiz038 | 0:2b3b9e3c61d7 | 11 | int main() { |
| Bleiz038 | 0:2b3b9e3c61d7 | 12 | R.period(Time); |
| Bleiz038 | 0:2b3b9e3c61d7 | 13 | G.period(Time); |
| Bleiz038 | 0:2b3b9e3c61d7 | 14 | B.period(Time); |
| Bleiz038 | 0:2b3b9e3c61d7 | 15 | G.write(0.5); |
| Bleiz038 | 0:2b3b9e3c61d7 | 16 | while (1){ |
| Bleiz038 | 0:2b3b9e3c61d7 | 17 | ValR = P1; |
| Bleiz038 | 0:2b3b9e3c61d7 | 18 | ValB = P2; |
| Bleiz038 | 0:2b3b9e3c61d7 | 19 | R.write(ValR); |
| Bleiz038 | 0:2b3b9e3c61d7 | 20 | B.write(ValB); |
| Bleiz038 | 0:2b3b9e3c61d7 | 21 | wait(0.01); |
| Bleiz038 | 0:2b3b9e3c61d7 | 22 | } |
| Bleiz038 | 0:2b3b9e3c61d7 | 23 | } |