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: HIDScope biquadFilter mbed
Fork of EMGvoorjan by
Diff: main.cpp
- Revision:
- 31:620950f7e514
- Parent:
- 30:4c6321941515
diff -r 4c6321941515 -r 620950f7e514 main.cpp
--- a/main.cpp Wed Oct 25 12:38:09 2017 +0000
+++ b/main.cpp Wed Oct 25 12:54:26 2017 +0000
@@ -122,8 +122,8 @@
// bits for motor 1. Positive value makes motor rotating
// clockwise. motorValues outside range are truncated to
// within range
- if (fabs(motorValue)>1) motor2MagnitudePin = 1;
- else motor2MagnitudePin = fabs(motorValue);
+ if (motorValue>1) motor2MagnitudePin = 1;
+ else motor2MagnitudePin = motorValue;
}
float FeedForwardControl(float referenceVelocity) {
// very simple linear feed-forward control
@@ -152,6 +152,6 @@
while(1) {
MotorOn.rise(&MotorLocker);
motor2DirectionPin = 1;
- SetMotor2(FeedForwardControl(GetReferenceVelocity()));
- }
+ SetMotor2(0.5);
+ }
}
\ No newline at end of file
