a

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

Fork of Servo by Tk A

Files at this revision

API Documentation at this revision

Comitter:
choutin
Date:
Thu Sep 08 10:07:15 2016 +0000
Parent:
1:c8ecfd809e22
Child:
4:5ae6ed80dc46
Commit message:
k

Changed in this revision

servo.cpp Show annotated file Show diff for this revision Revisions of this file
servo.h Show annotated file Show diff for this revision Revisions of this file
--- a/servo.cpp	Wed Sep 07 09:40:58 2016 +0000
+++ b/servo.cpp	Thu Sep 08 10:07:15 2016 +0000
@@ -28,17 +28,21 @@
        
 }
 
-void beltdegree(int degree) {
-    int i;
+void beltup(void){
 
    pwmarm.period_ms(20);        //20ms
-   
-       degree=10;
-
-       i=500+degree*1900/180;
-       pwmbelt.write(i/PERIOD); 
+       pwmbelt.write(0.05); 
        
 }
+
+void beltdown(void){
+
+   pwmarm.period_ms(20);        //20ms
+       pwmbelt.write(0.1); 
+       
+}
+
+
 void close_hand(void) {
      int i,degree;
 
@@ -47,7 +51,7 @@
         degree=175;
 
         i=500+degree*1900/180;
-        pwmhand.pulsewidth_us(i); 
+        pwmhand.write(i/PERIOD); 
         
         
 }
@@ -57,7 +61,7 @@
 
    pwmarm.period_ms(20);        //20ms
    
-       degree=160;
+       degree=100;
 
        i=500+degree*1900/180;
        pwmarm.write(i/PERIOD); 
--- a/servo.h	Wed Sep 07 09:40:58 2016 +0000
+++ b/servo.h	Thu Sep 08 10:07:15 2016 +0000
@@ -12,4 +12,6 @@
 
 void handdegree(int degree);
 
-void beltdegree(int degree);
\ No newline at end of file
+void beltup(void);
+
+void beltdown(void);
\ No newline at end of file