homing

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
s1725696
Date:
Thu Nov 01 10:41:22 2018 +0000
Parent:
1:555373c1b9be
Commit message:
without homing for rotation

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 555373c1b9be -r ff77628098e4 main.cpp
--- a/main.cpp	Thu Nov 01 10:34:03 2018 +0000
+++ b/main.cpp	Thu Nov 01 10:41:22 2018 +0000
@@ -13,7 +13,9 @@
 void translation_stop(){}
 void rotation_start(int a, int b){}
 void rotation_stop(){}
-int main(){
+
+void homing()
+{
     //translation home
     if (counts2 > ((tower_end_position - tower_1_position)/2)){
         translation_start(0,1);
@@ -29,19 +31,10 @@
         }
     else{}
     
-    //rotation home
-    if ((counts1 - (revcounts * (counts1 / revcounts))) > (rotation_end_position)){
-        rotation_start(0,1);
-        }
-    else{
-        rotation_start(1,1);
-        }
-    if ((counts1 - (revcounts * (counts1 / revcounts))) > (rotation_end_position - 100)){ //check if motor 1 is in the right position within 100 counts range
-        if ((counts1 - (revcounts * (counts1 / revcounts))) < (rotation_end_position + 100)){
-        rotation_stop();
-            }
-        else {}
-        }
-    else {}
     }
+    
+int main()
+{
+  homing();
+  }
   
\ No newline at end of file