Dependencies:   Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
shiyuu
Date:
Sat Oct 11 04:09:08 2014 +0000
Commit message:
????????????

Changed in this revision

Servo.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Sat Oct 11 04:09:08 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/Servo/#36b69a7ced07
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Oct 11 04:09:08 2014 +0000
@@ -0,0 +1,59 @@
+#include "mbed.h"
+#include "Servo.h"
+ 
+Servo Head(p22);
+Servo Ball(p23); 
+ 
+Serial TMsan(p9,p10);
+//Serial pc(USBTX,USBRX);
+
+int main() {
+    
+    /*   宣言   */
+    int i,kk,redata =0;   //主に使うカウンターと、首カックンチョ・カウンター,高松さんレシーブ用
+    
+    /*      データ来るまで出れまテン    */
+    while(1){
+    redata=TMsan.getc();    //高松さんからのデータを受信    
+    if(redata!=0){
+        break;
+        }  
+    }
+        
+        Ball.calibrate(0.0021,45.0);//ぶっ壊れサーボを回し続ける
+        Ball=1.0;
+        
+        Head.position(0.3);
+        Head.calibrate(0.0004,40.0);//正常なほうのサーボ     (範囲,角度)
+        
+    while(1) {
+   
+    for(i=0;i<100;i++){
+        Head=i/100.0;
+        wait(0.01);
+        }
+        
+    for(kk=1;kk<=2;kk++){  //首をカックンチョするためのやつ
+        
+        for(i=100;i>80;i--){
+            Head=i/100.0;       //  --- 往路 ---
+            wait(0.01);
+            }
+        
+            //wait (0.5);
+        
+        for(i=80;i<100;i++){    //  --- 復路 ---
+            Head=i/100.0;
+            wait(0.01);
+            }
+            
+    }   //カックンチョend
+        
+    for(i=100;i>0;i--){
+        Head=i/100.0;
+        wait(0.01);
+        }
+        
+           
+    }//while
+}//main
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Oct 11 04:09:08 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1
\ No newline at end of file