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: QEI mbed-rtos mbed
Diff: main.cpp
- Revision:
- 7:59613b7a1631
- Parent:
- 6:16da0de99a8c
- Child:
- 8:57c2b7c94ce8
--- a/main.cpp Tue Dec 03 16:47:34 2013 +0000 +++ b/main.cpp Wed Dec 04 01:49:01 2013 +0000 @@ -14,7 +14,7 @@ #define BUFFER_SIZE 4200 #define MAX_VOLTAGE 3.3 #define VOLTS_PER_AMP 0.14 - +#define PROGRAM_RUNTIME 15.0 Serial pc(USBTX, USBRX); @@ -55,7 +55,7 @@ void saving(void const *args) { index = 0; - while ((index < BUFFER_SIZE)&&(flag == 1)) { + while ((index < BUFFER_SIZE)&&(flag == 1)&&(false)) { buffer[index] = theta1; buffer[index+1] = theta2; buffer[index+2] = dtheta1; @@ -86,7 +86,7 @@ void computing(void const *args) { float z1 = 0.0, z2 = 0.0, dz1 = 0.0, dz2 = 0.0, z3 = 0.0, dz3 = 0.0; - while (true) { + while (true ) { t = T.read(); //set pwm @@ -170,7 +170,7 @@ pc.printf("Start!\r\n"); pc.printf("Time: %f\r\n", t); - while (t < 10.0) + while (t < PROGRAM_RUNTIME) { //pc.printf("Time: %f\r\n", t); Thread::wait(1000);