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.
Diff: main.cpp
- Revision:
- 1:c4041164cc76
- Parent:
- 0:60727c2b0359
diff -r 60727c2b0359 -r c4041164cc76 main.cpp
--- a/main.cpp Mon Mar 31 08:02:31 2014 +0000
+++ b/main.cpp Mon Mar 31 09:45:32 2014 +0000
@@ -1,19 +1,17 @@
#include "mbed.h"
-
-PwmOut pwm(dp18);
-AnalogIn ain(dp9);
-
+
+PwmOut pwm_out(dp18);
+AnalogIn voltmeter(dp9);
+
int main() {
- pwm.period_us(50);
- float potenciometar=ain;
- int i=0;
- while(1) {
- if(i%120==0)
- {
- potenciometar=ain;
- i=1;
- }
- pwm=ain;
- i++;
+
+ // initialize
+ pwm_out = 0.;
+ pwm_out.period_us(500);
+
+ while(true) {
+ pwm_out = voltmeter;
}
+
+ return 0; // unreachable
}
\ No newline at end of file