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.
training.h
- Committer:
- MarcelPortmann
- Date:
- 2020-04-28
- Revision:
- 1:aa8497b98ef4
- Parent:
- 0:0c6d1b9144af
- Child:
- 2:0df0d0be0664
File content as of revision 1:aa8497b98ef4:
/*
Training Class for EasyFitnes
This class loads Position data from the memory and compairs it with the data wich
is transmitet from the IMU via the main programm
it counts all misstaiks over a certain value and reports them back.
when questions ask someone else
the autor is not responsible for any spelling mistakes
*/
#include <vector>
#include <string>
#include "mbed.h"
#include "memory.h"
#ifndef training_H // no idea what this does
#define training_H // seems important
#define POSTOL 20 // max pos toleranz point to point in mm
#define TIMETOL 3 // max time toleranz
#define SHORTMAX 5 // max time to short
#define LONGMAX 5 // max time to long
#define FAILPOSMAX 100 // max position fails
struct posdata{
int time;
int hi, low;
bool end, start;
float pos[3];
};
class training
{
public:
training(void);
void load_training(string name); // loads a training from the sd card into the flash
void start_training(void); // sets all parameters to begin training
void compire_point(float posx,float posy,float posz, int time); // compairs curent point to memory point and counts repetitions
void end_training(void); // creates a feedback and stores it into the SD card
private:
std::vector<posdata> data_vec; // dynamic array for trainings data
int fail_pos;
int time_short;
int time_long;
int repet;
int point_count;
memory loading;
string tr_name;
struct posdata temp;
};
#endif