tetsuro hirano
/
NewCyroroProto
test
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "AX12.h" 00003 00004 int main() { 00005 00006 00007 AX12 myax12 (p9, p10, 1); // AX12(txPin rxPin id) 00008 myax12.SetMode(1);///position servo: 0, speed servo:1 00009 //Sample Program 00010 /*while (1) { 00011 myax12.SetGoal(0); // go to 0 degrees 00012 wait (2.0); 00013 myax12.SetGoal(300); // go to 300 degrees 00014 wait (2.0); 00015 } 00016 00017 */ 00018 00019 LocalFileSystem local("local"); 00020 00021 00022 //FILE *fp; 00023 int i=0; 00024 00025 while (1) { 00026 00027 myax12.SetCRSpeed(0.5); 00028 //float ang = myax12.GetPosition(); 00029 00030 //fp = fopen("/local/out.txt", "a"); // ファイルを書き込みモードで開く 00031 //fprintf(fp, "\n %f",ang); 00032 //fclose(fp); 00033 i++; 00034 } 00035 00036 // */ 00037 }
Generated on Sun Jul 17 2022 19:47:53 by 1.7.2