Boleh bisa langsung dicoba, tap servo base belum dikalibrasi

Dependencies:   mbed Servo

Files at this revision

API Documentation at this revision

Comitter:
andremanurung
Date:
Thu May 16 05:08:40 2019 +0000
Parent:
12:6db54df00e14
Commit message:
Typo yt -> zt

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 6db54df00e14 -r e465ee0ccafb main.cpp
--- a/main.cpp	Wed May 15 10:50:56 2019 +0000
+++ b/main.cpp	Thu May 16 05:08:40 2019 +0000
@@ -149,10 +149,10 @@
         teta1 = teta1_rad*180/pi;       //dalam derajat
         
         //--------mulai proses teta2--------
-        if((xt>0)&&(yt>0)){
+        if((xt>0)&&(zt>0)){
             float teta2_rad = rum2_tet(teta1_rad,xt,yt,zt,r1,r2)-teta1_rad;
             teta2 = teta2_rad*180/pi;       
-        }else if((xt>0)&&(yt<0)){
+        }else if((xt>0)&&(zt<0)){
             float teta2_rad = teta1_rad-rum1_tet(teta1_rad,xt,yt,zt,r1,r2);
             teta2 = teta2_rad*180/pi;
         }