test

Dependencies:   AX12 mbed

Revision:
0:3707b95b0127
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun May 03 11:55:52 2015 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+#include "AX12.h"
+ 
+int main() {
+    
+    
+    AX12 myax12 (p9, p10, 1); // AX12(txPin rxPin id)
+    myax12.SetMode(1);///position servo: 0, speed servo:1
+    //Sample Program
+    /*while (1) {
+        myax12.SetGoal(0);    // go to 0 degrees
+        wait (2.0);
+        myax12.SetGoal(300);  // go to 300 degrees
+        wait (2.0);
+    }
+    
+    */
+    
+    LocalFileSystem local("local");
+      
+    
+    //FILE *fp;
+    int i=0;
+    
+    while (1) {
+        
+        myax12.SetCRSpeed(0.5);
+        //float ang = myax12.GetPosition();
+        
+        //fp = fopen("/local/out.txt", "a");  // ファイルを書き込みモードで開く
+        //fprintf(fp, "\n %f",ang);
+        //fclose(fp);
+        i++;        
+    } 
+     
+    // */   
+}