Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 //ball direction 00002 double ball_sankaku[16][2] = { 00003 {0 , 1 }, 00004 {0.390 , 0.920}, 00005 {0.707 , 0.707}, 00006 {0.927 , 0.374}, 00007 {1 , 0 }, 00008 {0.920 ,-0.390}, 00009 {0.707 ,-0.707}, 00010 {0.374 ,-0.927}, 00011 {0 ,-1 }, 00012 {-0.390,-0.920}, 00013 {-0.707,-0.707}, 00014 {-0.927,-0.374}, 00015 {-1 , 0 }, 00016 {-0.920, 0.390}, 00017 {-0.707, 0.707}, 00018 {-0.374, 0.927} 00019 }; 00020 00021 //turn direction 00022 double turn_sankaku[16][2] = { 00023 { 0 ,0 } 00024 { 0.920,-0.390 } 00025 { 0.707,-0.707 } 00026 { 0.374,-0.927 } 00027 { 0 ,-1 } 00028 {-0.390,-0.920 } 00029 {-0.707,-0.707 } 00030 {-0.927,-0.374 } 00031 {-0.927,-0.374 } 00032 {0.920 ,-0.390 } 00033 {0.707 ,-0.707 } 00034 {0.374 ,-0.927 } 00035 {0 ,-1 } 00036 {-0.390,-0.920 } 00037 {-0.707,-0.707 } 00038 {-0.927,-0.374 } 00039 }; 00040 00041 if(ballturn){ 00042 if(distance<10){ 00043 x_dista = pow*(-ball_sankaku[direc][0]); 00044 y_dista = pow*(-ball_sankaku[direc][1]); 00045 }else if(distance>30){ 00046 x_dista = pow*(+ball_sankaku[direc][0]); 00047 y_dista = pow*(+ball_sankaku[direc][1]); 00048 } 00049 00050 x_turn = pow*(turn_sankaku[direc][0]); 00051 y_turn = pow*(turn_sankaku[direc][1]); 00052 00053 00054 X = x_dista + x_turn; 00055 Y = y_dista + y_turn; 00056 }
Generated on Tue Jul 12 2022 23:06:11 by
1.7.2