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.
Diff: main.cpp
- Revision:
- 3:43a6f6157fcf
- Parent:
- 2:d28f9138ca4b
- Child:
- 4:1b193f02cfb1
--- a/main.cpp Wed Sep 09 10:36:36 2020 +0000 +++ b/main.cpp Thu Sep 17 07:09:17 2020 +0000 @@ -54,23 +54,24 @@ CANMessage msg; // remote msg? what determines the size(msg)? can1.frequency(1000000); can2.frequency(1000000); // CANbus=1Mbps th=12.3456; id=1; -// pc.baud(115200); // 9600(default) 115200(max, maybe) - - while(1){ - pc.printf("+++(main of th2mot)... +feed theta(double)[deg][0.-360.]"); - pc.scanf("%lf", &th); + // 9600(default) 115200(not max?) 921600(on STM32F446, benkatz) + pc.baud(921600); + + while(1){ + pc.printf("+++(main of th2mot)... +feed theta(double)[deg][0.-360.]"); + pc.scanf("%lf", &th); - th2mot(th, id); - wait(0.2); // dummy wait 0.2[s] - if(can1.read(msg)) { // org=can2 - c_read++; led2 = !led2; - pc.printf(" ++can2 c_read=%d, d[0..7]_read=(0x", c_read); - for(int i=0; i<8; i++) pc.printf("%02X ", msg.data[i]); - pc.printf(") \n\r"); - } // endof can1.read - else - pc.printf(" ++failed can1.read... c_sent=%d\n\r", c_sent); - } // endof while(1)-loop + th2mot(th, id); + wait(0.2); // dummy wait 0.2[s] + if(can1.read(msg)) { // org=can2 + c_read++; led2 = !led2; + pc.printf(" ++can2 c_read=%d, d[0..7]_read=(0x", c_read); + for(int i=0; i<8; i++) pc.printf("%02X ", msg.data[i]); + pc.printf(") \n\r"); + } // endof can1.read + else + pc.printf(" ++failed can1.read... c_sent=%d\n\r", c_sent); + } // endof while(1)-loop } // endof main