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:
- 0:8709fd38c8ee
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Oct 29 18:32:27 2018 +0000
@@ -0,0 +1,15 @@
+#include "mbed.h"
+AnalogIn pot(A0);
+PwmOut motor(D6);
+
+int main() {
+ //motor.period_us(20000);
+ while(1) {
+ float ancho = pot*1000.0;
+ float anchoservo= 2000.0 - ancho;
+ //motor.write(ancho);
+ motor.pulsewidth_us(anchoservo);
+
+ }
+}
+