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: MatrixMult.cpp
- Revision:
- 0:9914ce5b3003
- Child:
- 1:fda67b3a1100
diff -r 000000000000 -r 9914ce5b3003 MatrixMult.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MatrixMult.cpp Mon Oct 29 16:00:04 2018 +0000 @@ -0,0 +1,35 @@ +#include "mbed.h" +#include "math.h" +#include "MODSERIAL.h" + +MODSERIAL pc(USBTX, USBRX); + +int main() +{ + pc.baud(115200); + pc.printf("Hello World!\r\n"); + float L0 = 0.1; + float L1 = 0.326; + float L2 = 0.209; + float q1 = 0; + float q2 = 0; + float Oe0_x; + float inv_Oe0_x; + float Oe0_y; + float inv_Oe0_y; + +//Oe0x +Oe0_x = L0 + cos(q1)*(L0 + L1 - cos(q2)*(L0 + L1)) - L0*cos(q1) + (cos(q1)*cos(q2) - sin(q1)*sin(q2))*(L0 + L1 - L2) + sin(q1)*sin(q2)*(L0 + L1); +inv_Oe0_x = -Oe0_x; + +//Oe0y +Oe0_y = sin(q1)*(L0 + L1 - cos(q2)*(L0 + L1)) - L0*sin(q1) + (cos(q1)*sin(q2) + cos(q2)*sin(q1))*(L0 + L1 - L2) - cos(q1)*sin(q2)*(L0 + L1); +inv_Oe0_y = -Oe0_y; + +pc.printf("Oe0_x = %f, Oe0_y = %f, inv_Oe0_x = %f and inv_Oe0_y = %f \r\n", Oe0_x, Oe0_y, inv_Oe0_x, inv_Oe0_y); // print the value of variable c + + + + +} +