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.
Dependencies: Encoder MODSERIAL mbed
Fork of DEMO by
Diff: main.cpp
- Revision:
- 6:9943f69ff668
- Parent:
- 5:9651c3f7602b
- Child:
- 7:1d3eefa00e20
--- a/main.cpp Thu Nov 02 11:47:56 2017 +0000
+++ b/main.cpp Thu Nov 02 13:09:51 2017 +0000
@@ -66,7 +66,7 @@
Motor1Set = (q1/(2*pi))*maxwaarde; //Calculate the desired motor1 angle from the desired joint positions
- Motor2Set = ((pi-q2-q1)/(2*pi))*maxwaarde; //Calculate the desired motor2 angle from the desired joint positions
+ Motor2Set = -((pi-q2-q1)/(2*pi))*maxwaarde; //Calculate the desired motor2 angle from the desired joint positions
pc.printf("waarde p = %f, waarde pp = %f, a= %f, aa = %f, bb = %f, cc = %f \r\n",p,pp,a,aa,bb,cc);
//pc.printf("q1 = %f, q2 = %f, Motor1Set = %f, Motor2Set = %f \r\n", q1, q2, Motor1Set, Motor2Set);
@@ -177,11 +177,11 @@
{
if (motorValue2 >= 0)
{
- M2D = 0;
+ M2D = 1;
}
else
{
- M2D = 1;
+ M2D = 0;
}
if (fabs(motorValue2) > 1)
