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 MODSERIAL QEI biquadFilter mbed
Fork of Robot-Software by
Diff: main.cpp
- Branch:
- bla
- Revision:
- 11:c8251a1362b7
- Parent:
- 10:7339dca7d604
- Parent:
- 9:8e1112874c12
- Child:
- 12:3c47c7b1d1d7
--- a/main.cpp Tue Oct 23 08:44:17 2018 +0000
+++ b/main.cpp Tue Oct 23 08:48:06 2018 +0000
@@ -32,12 +32,13 @@
//Global variables/objects
States current_state;
Ticker loop_ticker; //The Ticker object that will ensure perfect timing of our looping code
-float e, u1, u2, emg_signal_raw_0, processed_emg_0, emg_signal_raw_1, processed_emg_1, robot_end_point, reference_end_point, motor_angle, motor_counts, q_ref; //will be set by the motor_controller function
+double e, u1, u2, emg_signal_raw_0, processed_emg_0, emg_signal_raw_1, processed_emg_1, robot_end_point, reference_end_point, motor_angle, motor_counts, q_ref; //will be set by the motor_controller function
int counts_per_rotation = 32;
bool state_changed = false;
double samplingfreq = 1000;
double x; // Making the position (x,y) of the end effector global
double y;
+const double T = 0.001;
float processing_chain_emg(int num) {
return 6.0;
@@ -69,6 +70,7 @@
if (button.read()==true)
{
current_state = calib_enc; //the NEXT loop we will be in calib_enc state
+ // no state_changed action?
}
break; //to avoid falling through to the next state, although this can sometimes be very useful.
