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: ExperimentServer QEI_pmw MotorShield
Diff: main.cpp
- Revision:
- 18:54195aa5e534
- Parent:
- 17:98e298577f09
- Child:
- 19:d58bf34141e9
--- a/main.cpp Fri Sep 25 01:07:22 2020 +0000 +++ b/main.cpp Fri Sep 25 18:30:00 2020 +0000 @@ -6,7 +6,7 @@ #include "MotorShield.h" #include "HardwareSetup.h" -#define NUM_INPUTS 8 +#define NUM_INPUTS 9 #define NUM_OUTPUTS 6 float velocity = 0; float current = 0; @@ -19,6 +19,7 @@ float R =0; float emf =0; float th_d= 0; +float period=0; Serial pc(USBTX, USBRX); // USB Serial Terminal ExperimentServer server; // Object that lets us communicate with MATLAB @@ -88,8 +89,9 @@ float k = input_params[5]; float b = input_params[6]; float D = input_params[7]; + period = input_params[8]; - ControlLoop.attach(¤t_control,0.0001); //start current loop + ControlLoop.attach(¤t_control,period); //start current loop // Setup experiment t.reset();