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: mbed QEI HIDScope biquadFilter MODSERIAL FastPWM
functions.h@40:82addb417220, 2019-10-14 (annotated)
- Committer:
- JornD
- Date:
- Mon Oct 14 11:46:35 2019 +0000
- Revision:
- 40:82addb417220
- Parent:
- header.h@33:5e2e95c322da
- Child:
- 43:9579a1afe9cb
Added some files and commented out Jordan's code;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JornD | 24:d0ca537913c2 | 1 | #ifndef header_h |
JornD | 24:d0ca537913c2 | 2 | #define header_h |
JornD | 24:d0ca537913c2 | 3 | int AddInt(int a, int b); |
JordanO | 27:71be6e074d0f | 4 | |
JordanO | 18:266f1ffdc9c4 | 5 | double ControllerPID(double e, double Ts); //e = error, Ts = sampling time |
JornD | 33:5e2e95c322da | 6 | //void motorAndEncoder(float PWM1, float PWM2, float dt); |
JornD | 33:5e2e95c322da | 7 | |
JornD | 40:82addb417220 | 8 | |
JornD | 33:5e2e95c322da | 9 | |
JornD | 33:5e2e95c322da | 10 | //Define global variables |
JornD | 33:5e2e95c322da | 11 | extern double X; //Input from EMG, signal X |
JornD | 33:5e2e95c322da | 12 | |
JornD | 33:5e2e95c322da | 13 | //Define structures |
JornD | 40:82addb417220 | 14 | |
JornD | 33:5e2e95c322da | 15 | |
JornD | 24:d0ca537913c2 | 16 | #endif |
JordanO | 18:266f1ffdc9c4 | 17 | |
JornD | 24:d0ca537913c2 | 18 | //double motorAndEncoder(float voltage1, float periodMotor1, float voltage2, float periodMotor2, float dt, float &countsMotor1Return, float &countsMotor2Return, float &velocityMotor1Return, float &velocityMotor2Return); |
JordanO | 19:07706535ff7b | 19 | //voltage in PWM (between -1 and 1), -1 for negative direction full power, 1 for positive direction full power |
JordanO | 18:266f1ffdc9c4 | 20 | //period in seconds |
JordanO | 19:07706535ff7b | 21 | //dt the time between measurements, i.o.w. Ticker timing, for velocity calculation |
JordanO | 18:266f1ffdc9c4 | 22 | //Returns (velocityMotor1, velocityMotor2, countsMotor1[1], countsMotor2[0]) |
JornD | 23:767911637f3a | 23 | //Velocity in radians/s |
JornD | 23:767911637f3a | 24 | |
JornD | 24:d0ca537913c2 | 25 | //double ProcessEMG(double X); |