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.
Revision 0:68ec2377b85c, committed 2014-09-04
- Comitter:
- LanierUSNA16
- Date:
- Thu Sep 04 03:06:21 2014 +0000
- Commit message:
- step 5;
Changed in this revision
diff -r 000000000000 -r 68ec2377b85c Servo.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Servo.lib Thu Sep 04 03:06:21 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/simon/code/Servo/#36b69a7ced07
diff -r 000000000000 -r 68ec2377b85c main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Sep 04 03:06:21 2014 +0000
@@ -0,0 +1,34 @@
+#include "mbed.h"
+#include "servo.h"
+//Lab 2, step 5
+
+//code given by professor
+Serial pc(USBTX, USBRX);
+
+//establish pwm out on pin 21
+PwmOut servo1(p21);
+//establish analogin on pin 15
+AnalogIn ain(p15);
+
+int main()
+ {//begin main
+
+ //create float variable where the voltage input can be stored
+ float signal = 0.0;
+
+ while (1)
+ {//begin while
+ //set computer sampling rate
+ pc.baud(921600);
+ //assign input voltage to the variable 'signal'
+ signal = ain;
+
+ //set servo position to the value of 'signal' the input voltage
+ servo1.write(signal);
+
+ wait(1);
+
+ }//end while
+
+
+ }//end main
\ No newline at end of file
diff -r 000000000000 -r 68ec2377b85c mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Sep 04 03:06:21 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013 \ No newline at end of file