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 2:50449384c230, committed 2021-06-09
- Comitter:
- e93858ek
- Date:
- Wed Jun 09 14:51:02 2021 +0000
- Parent:
- 1:40d2fd0b99e6
- Commit message:
- It works
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 40d2fd0b99e6 -r 50449384c230 main.cpp --- a/main.cpp Tue Nov 23 16:10:35 2010 +0000 +++ b/main.cpp Wed Jun 09 14:51:02 2021 +0000 @@ -3,11 +3,23 @@ #include "mbed.h" #include "Servo.h" -Servo myservo(p21); +Servo myservo(D2); +Servo myservo2(D3); + +AnalogIn pot1(A5); +AnalogIn pot2(A0); + +Serial pc(USBTX,USBRX); int main() { - for(float p=0; p<1.0; p += 0.1) { - myservo = p; - wait(0.2); + pc.printf("\nSetup Complete\n"); + while(1){ + double pot1_val = pot1.read(); + double pot2_val = pot2.read(); + myservo = pot1_val; + myservo2=pot2_val; + pc.printf("S1\tS2\n"); + pc.printf("%f\t%f\n", pot1_val, pot2_val); } + }
diff -r 40d2fd0b99e6 -r 50449384c230 mbed.bld --- a/mbed.bld Tue Nov 23 16:10:35 2010 +0000 +++ b/mbed.bld Wed Jun 09 14:51:02 2021 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file