a

Dependents:   3servotest 1stcomp 3rdcompfixstart 2ndcomp ... more

Fork of Servo by Tk A

Revision:
7:919db47443f4
Parent:
6:b0d581acc298
Child:
8:5a8a6a3b9f33
--- a/servo.cpp	Sun Sep 11 11:39:48 2016 +0000
+++ b/servo.cpp	Fri Sep 16 08:50:07 2016 +0000
@@ -5,6 +5,8 @@
 PwmOut pwmbelt(PC_9);
 float PERIOD=20000;
 
+const float btime=1.8;
+
 void armdegree(int degree) {
     int i;
 
@@ -82,7 +84,7 @@
 
    pwmhand.period_ms(20);        //20ms
    
-       degree=90;
+       degree=83;
 
        i=500+degree*1900/180;
        pwmhand.write(i/PERIOD); 
@@ -97,10 +99,18 @@
 
    pwmarm.period_ms(20);        //20ms
    
-       degree=50;
+       degree=30;
 
        i=500+degree*1900/180;
        pwmarm.write(i/PERIOD); 
        
        
 }
+
+void lift(){
+    
+beltup();
+wait(btime);
+beltstop();
+    
+}
\ No newline at end of file