Modified experiment example for lab 3 of 2.74
Dependencies: ExperimentServer MotorShield QEI_pmw
Diff: main.cpp
- Revision:
- 20:4c172a0737c6
- Parent:
- 19:d58bf34141e9
- Child:
- 21:94aeb8abe04c
--- a/main.cpp Sat Sep 26 00:17:32 2020 +0000 +++ b/main.cpp Sat Sep 26 00:19:16 2020 +0000 @@ -24,7 +24,7 @@ Serial pc(USBTX, USBRX); // USB Serial Terminal ExperimentServer server; // Object that lets us communicate with MATLAB Timer t; // Timer to measure elapsed time of experiment -Ticker ControlLoop; +Ticker ControlLoop; //Ticker object created QEI encoderA(PE_9,PE_11, NC, 1200, QEI::X4_ENCODING); // MOTOR A ENCODER (no index, 1200 counts/rev, Quadrature encoding) QEI encoderB(PA_5, PB_3, NC, 1200, QEI::X4_ENCODING); // MOTOR B ENCODER (no index, 1200 counts/rev, Quadrature encoding) @@ -91,7 +91,7 @@ float D = input_params[7]; period = input_params[8]; - ControlLoop.attach(¤t_control,period); //start current loop + ControlLoop.attach(¤t_control,period); //start current loop using Ticker function // Setup experiment t.reset();