yattaze
Dependencies: omni_all ikarashiMDC
Revision 0:00d1839224b6, committed 2019-05-02
- Comitter:
- THtakahiro702286
- Date:
- Thu May 02 08:48:06 2019 +0000
- Commit message:
- yattaze
Changed in this revision
diff -r 000000000000 -r 00d1839224b6 .gitignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.gitignore Thu May 02 08:48:06 2019 +0000 @@ -0,0 +1,4 @@ +.build +.mbed +projectfiles +*.py*
diff -r 000000000000 -r 00d1839224b6 ikarashiMDC.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ikarashiMDC.lib Thu May 02 08:48:06 2019 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/teams/NHK-Robocon2016_Nagaoka_B_Team/code/ikarashiMDC/#ea34af94e90c
diff -r 000000000000 -r 00d1839224b6 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu May 02 08:48:06 2019 +0000 @@ -0,0 +1,43 @@ +#include "mbed.h" +#include "omni_all.h" +#include "ikarashiMDC.h" + +Serial pc(USBTX, USBRX, 115200); +Serial serial(PC_6,PC_7); +DigitalOut serialcontrol(D2); +Omni_all omni(3); //オムニホイールの単位円上の位置を入力 +Timer rad; + +ikarashiMDC ikarashi[] { + ikarashiMDC(&serialcontrol,2,0,SM,&serial), + ikarashiMDC(&serialcontrol,2,1,SM,&serial), + ikarashiMDC(&serialcontrol,2,2,SM,&serial) +}; + +int main() +{ + double acc[3]; + serial.baud(115200); + ikarashi[0].braking = true; + for(int i = 0; i < 3; i++) + { + omni.sendRad(PI * (1+4*i)/6, i); + } + rad.start(); + while(1) + { + if(rad >= (PI * 2)) + { + rad.reset(); + } + for(int i = 0; i < 3; i++) + { + acc[i] = omni.vec(rad,i); + } + for(int i = 0; i < 3;i++) + { + ikarashi[i].setSpeed(acc[i] / 2); + } + pc.printf("%f,%f,%f\r\n",acc[0],acc[1],acc[2]); + } +} \ No newline at end of file
diff -r 000000000000 -r 00d1839224b6 mbed-os.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Thu May 02 08:48:06 2019 +0000 @@ -0,0 +1,1 @@ +https://github.com/ARMmbed/mbed-os/#c9e63f14085f5751ff5ead79a7c0382d50a813a2
diff -r 000000000000 -r 00d1839224b6 omni_all.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/omni_all.lib Thu May 02 08:48:06 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/THtakahiro702286/code/omni_all/#657446f249bc