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.
Dependencies: Motor Servo mbed mbed-rtos
Revision 7:adcdd7556997, committed 2018-10-22
- Comitter:
- m215676
- Date:
- Mon Oct 22 00:18:49 2018 +0000
- Parent:
- 6:3dc339508843
- Commit message:
- 10/21
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file | 
| mbed-rtos.lib | Show annotated file Show diff for this revision Revisions of this file | 
--- a/main.cpp	Tue Oct 16 13:38:55 2018 +0000
+++ b/main.cpp	Mon Oct 22 00:18:49 2018 +0000
@@ -11,9 +11,9 @@
 float x;
 float y;
 AnalogIn turn(p15);  //turn dial to adjust servo for horizontal angle of arm SWITCH 2
-DigitalIn swtch1(p19); //moves herndon monument on turn table continuously while switch is on
-DigitalIn swtch3(p20); //releases the cover when switch 3 is turned on
-DigitalIn swtch4(p21); //retracts arm back to starting position to try again
+DigitalIn swtch1(p25); //moves herndon monument on turn table continuously while switch is on
+DigitalIn swtch3(p18); //releases the cover when switch 3 is turned on
+DigitalIn swtch4(p19); //retracts arm back to starting position to try again
 Motor m(p26, p30, p29); //launches the cover
 //DigitalIn sw1 (p16) ;     not sure why this is here - maybe broken pin
 
@@ -21,6 +21,7 @@
 Servo angle(p22); //servo to adjust horizontal angle of arm
 
 int main() {
+    /*
     s1 = swtch1.read(); //read state of switch 1
     angle.calibrate(0.0009, 90.0);
     back.calibrate(0.0009, 90.0); //calculate's servos timing by setting pulse width and range
@@ -58,10 +59,11 @@
    
 } //end of while loop
 
-
+*/
+while(1) {
     
-    sw3.read(); //read state of switch 3 (launch the cover)
-    if (sw3==1) {
+    swtch3.read(); //read state of switch 3 (launch the cover)
+    if (swtch3==1) {
         while(1) {
             printf("motor on");
             m.speed(1.0);
@@ -76,7 +78,7 @@
         
         
         
-    sw4.read(); //read state of switch 4 (retract arm to try again)
+    s4 = swtch4.read(); //read state of switch 4 (retract arm to try again)
     if (s4 == 1){
         while(1) {
            printf("reversed");
@@ -88,4 +90,5 @@
             break;
         } //end of while
         } //end of if
-        
+        }//end of int main
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-rtos.lib Mon Oct 22 00:18:49 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/teams/ST/code/mbed-rtos/#83895f30f8f2

