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@0:60727c2b0359, 2014-03-31 (annotated)
- Committer:
- tim008
- Date:
- Mon Mar 31 08:02:31 2014 +0000
- Revision:
- 0:60727c2b0359
- Child:
- 1:c4041164cc76
LV5-Zad2-PAI-Grupa1-Tim008
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| tim008 | 0:60727c2b0359 | 1 | #include "mbed.h" |
| tim008 | 0:60727c2b0359 | 2 | |
| tim008 | 0:60727c2b0359 | 3 | PwmOut pwm(dp18); |
| tim008 | 0:60727c2b0359 | 4 | AnalogIn ain(dp9); |
| tim008 | 0:60727c2b0359 | 5 | |
| tim008 | 0:60727c2b0359 | 6 | int main() { |
| tim008 | 0:60727c2b0359 | 7 | pwm.period_us(50); |
| tim008 | 0:60727c2b0359 | 8 | float potenciometar=ain; |
| tim008 | 0:60727c2b0359 | 9 | int i=0; |
| tim008 | 0:60727c2b0359 | 10 | while(1) { |
| tim008 | 0:60727c2b0359 | 11 | if(i%120==0) |
| tim008 | 0:60727c2b0359 | 12 | { |
| tim008 | 0:60727c2b0359 | 13 | potenciometar=ain; |
| tim008 | 0:60727c2b0359 | 14 | i=1; |
| tim008 | 0:60727c2b0359 | 15 | } |
| tim008 | 0:60727c2b0359 | 16 | pwm=ain; |
| tim008 | 0:60727c2b0359 | 17 | i++; |
| tim008 | 0:60727c2b0359 | 18 | } |
| tim008 | 0:60727c2b0359 | 19 | } |