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.
main.cpp@1:c4041164cc76, 2014-03-31 (annotated)
- Committer:
- tim008
- Date:
- Mon Mar 31 09:45:32 2014 +0000
- Revision:
- 1:c4041164cc76
- Parent:
- 0:60727c2b0359
lv5_tim008_zad2
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| tim008 | 0:60727c2b0359 | 1 | #include "mbed.h" |
| tim008 | 1:c4041164cc76 | 2 | |
| tim008 | 1:c4041164cc76 | 3 | PwmOut pwm_out(dp18); |
| tim008 | 1:c4041164cc76 | 4 | AnalogIn voltmeter(dp9); |
| tim008 | 1:c4041164cc76 | 5 | |
| tim008 | 0:60727c2b0359 | 6 | int main() { |
| tim008 | 1:c4041164cc76 | 7 | |
| tim008 | 1:c4041164cc76 | 8 | // initialize |
| tim008 | 1:c4041164cc76 | 9 | pwm_out = 0.; |
| tim008 | 1:c4041164cc76 | 10 | pwm_out.period_us(500); |
| tim008 | 1:c4041164cc76 | 11 | |
| tim008 | 1:c4041164cc76 | 12 | while(true) { |
| tim008 | 1:c4041164cc76 | 13 | pwm_out = voltmeter; |
| tim008 | 0:60727c2b0359 | 14 | } |
| tim008 | 1:c4041164cc76 | 15 | |
| tim008 | 1:c4041164cc76 | 16 | return 0; // unreachable |
| tim008 | 0:60727c2b0359 | 17 | } |