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:ab75773ee4f5
diff -r 000000000000 -r ab75773ee4f5 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Mar 01 03:46:56 2016 +0000
@@ -0,0 +1,34 @@
+ // Servo Tester
+
+#include "mbed.h"
+#include "I2cLCD.h"
+
+I2cLCD lcd(dp5,dp27,dp26); //sda scl reset
+PwmOut servo1(dp18);
+AnalogIn vr1_adc(dp9);
+
+double vr1,pduty1;
+
+#define ON 1
+#define OFF 0
+#define XON 0
+#define XOFF 1
+
+int main() {
+
+ lcd.cls();
+ lcd.locate(0,0);
+ lcd.printf("ServoSet");
+ wait(0.1);
+
+ while(1){
+ vr1=vr1_adc.read();
+ pduty1=(vr1+1.0)/1000;
+ servo1.pulsewidth(pduty1);
+ lcd.locate(0,1);
+ lcd.printf("%4.2fms",pduty1*1000);
+ wait(0.1);
+ }//while
+}//main
+
+