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: FastPWM HIDScope MODSERIAL QEI Matrix biquadFilter controller errorFetch mbed motorConfig refGen MatrixMath inverseKinematics
Fork of Minor_test_serial by
Revision 18:65e24db15c69, committed 2017-09-29
- Comitter:
- tvlogman
- Date:
- Fri Sep 29 08:08:19 2017 +0000
- Parent:
- 17:616ce7bc1f96
- Commit message:
- Removed HIDscope - that seems to prevent the entire program from working
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Sep 21 11:53:09 2017 +0000
+++ b/main.cpp Fri Sep 29 08:08:19 2017 +0000
@@ -9,7 +9,6 @@
QEI Encoder(D12,D13,NC,64, QEI::X4_ENCODING);
MODSERIAL pc(USBTX, USBRX);
-HIDScope scope(2);
// Defining outputs
DigitalOut motor1_direction(D4);
@@ -41,12 +40,9 @@
// Displaying revs in HIDscope
x = revs; // Capture data
- scope.set(0, x); // store data in first element of scope memory
y = (x_prev + x)/2.0; // averaging filter
- scope.set(1, y); // store data in second element of scope memory
x_prev = x; // Prepare for next round
- scope.send(); // send what's in scope memory to PC
}
void killSwitch(){
@@ -66,12 +62,14 @@
int main()
{
+ pc.baud(115200);
+ pc.printf("Entered main function");
motor1_direction = false;
motor1_pwm.period(pwmPeriod);//T=1/f
sw2.fall(&killSwitch);
sw3.fall(&turnMotorsOn);
button1.rise(&M1switchDirection);
- pc.baud(115200);
+
encoderTicker.attach(readEncoder, 0.1);
pc.printf("Encoder ticker attached and baudrate set");
