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 Teach memory
teach.h@2:6dc660d146b7, 2020-04-22 (annotated)
- Committer:
- MarcelPortmann
- Date:
- Wed Apr 22 08:39:40 2020 +0000
- Revision:
- 2:6dc660d146b7
- Parent:
- 1:33fdaabcdeda
- Child:
- 3:b22580585b9c
litel things missing;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MarcelPortmann | 0:ad924d8a2f98 | 1 | /* |
MarcelPortmann | 0:ad924d8a2f98 | 2 | teach function: |
MarcelPortmann | 0:ad924d8a2f98 | 3 | Class to aquier new tranings for the EasyFit Device. |
MarcelPortmann | 0:ad924d8a2f98 | 4 | It Records a position in the 3d room and puts the them in serie to create a "hose" to |
MarcelPortmann | 0:ad924d8a2f98 | 5 | be repeated in the mode Training. |
MarcelPortmann | 0:ad924d8a2f98 | 6 | |
MarcelPortmann | 0:ad924d8a2f98 | 7 | when questions ask someone else |
MarcelPortmann | 0:ad924d8a2f98 | 8 | the autor is not responsible for any spelling mistakes |
MarcelPortmann | 0:ad924d8a2f98 | 9 | |
MarcelPortmann | 0:ad924d8a2f98 | 10 | */ |
MarcelPortmann | 1:33fdaabcdeda | 11 | #include <vector> |
MarcelPortmann | 2:6dc660d146b7 | 12 | #include "mbed.h" |
MarcelPortmann | 0:ad924d8a2f98 | 13 | |
MarcelPortmann | 0:ad924d8a2f98 | 14 | #ifndef teach_H // no idea what this does |
MarcelPortmann | 0:ad924d8a2f98 | 15 | #define teach_H // seems important |
MarcelPortmann | 0:ad924d8a2f98 | 16 | |
MarcelPortmann | 2:6dc660d146b7 | 17 | #define MAX_SIZE 500000000 // maximal usebal flash befor error |
MarcelPortmann | 1:33fdaabcdeda | 18 | |
MarcelPortmann | 1:33fdaabcdeda | 19 | struct posdata{ |
MarcelPortmann | 1:33fdaabcdeda | 20 | int time; |
MarcelPortmann | 1:33fdaabcdeda | 21 | int hi, low; |
MarcelPortmann | 1:33fdaabcdeda | 22 | bool end, start; |
MarcelPortmann | 1:33fdaabcdeda | 23 | float pos[3]; |
MarcelPortmann | 1:33fdaabcdeda | 24 | }; |
MarcelPortmann | 1:33fdaabcdeda | 25 | |
MarcelPortmann | 1:33fdaabcdeda | 26 | struct temp_arry{ |
MarcelPortmann | 1:33fdaabcdeda | 27 | int time; |
MarcelPortmann | 1:33fdaabcdeda | 28 | float pos[3]; |
MarcelPortmann | 1:33fdaabcdeda | 29 | }; |
MarcelPortmann | 1:33fdaabcdeda | 30 | |
MarcelPortmann | 1:33fdaabcdeda | 31 | |
MarcelPortmann | 0:ad924d8a2f98 | 32 | |
MarcelPortmann | 0:ad924d8a2f98 | 33 | class teach |
MarcelPortmann | 0:ad924d8a2f98 | 34 | { |
MarcelPortmann | 0:ad924d8a2f98 | 35 | public: |
MarcelPortmann | 1:33fdaabcdeda | 36 | teach(void); // Sets all parameters for the class teach constructor |
MarcelPortmann | 1:33fdaabcdeda | 37 | |
MarcelPortmann | 0:ad924d8a2f98 | 38 | |
MarcelPortmann | 1:33fdaabcdeda | 39 | //functions to be used outside of class |
MarcelPortmann | 1:33fdaabcdeda | 40 | void setstart(float posx,float posy,float posz, int time); // creates a temporary begin of line point |
MarcelPortmann | 1:33fdaabcdeda | 41 | void setpoint(float posx,float posy,float posz, int time); // creates a temporary position point |
MarcelPortmann | 1:33fdaabcdeda | 42 | void setend(float posx,float posy,float posz, int time); // creates a temporary end of line point |
MarcelPortmann | 1:33fdaabcdeda | 43 | void save(void); // wen calld from main stores the whole training in memory |
MarcelPortmann | 1:33fdaabcdeda | 44 | void stop(void); // deleats all temp data and resets counters/pointers |
MarcelPortmann | 0:ad924d8a2f98 | 45 | |
MarcelPortmann | 0:ad924d8a2f98 | 46 | private: |
MarcelPortmann | 1:33fdaabcdeda | 47 | std::vector<posdata> data_vec; // Vektor mit allen datenpunkten |
MarcelPortmann | 1:33fdaabcdeda | 48 | int highcount,lowcount; // Counters for data recording |
MarcelPortmann | 1:33fdaabcdeda | 49 | void temp_store(void); // Stors data temporary; Data==Pointer to a Data Array (position(x,y,z),time) |
MarcelPortmann | 1:33fdaabcdeda | 50 | void process(void); // rounds the houses to trainings |
MarcelPortmann | 1:33fdaabcdeda | 51 | void contr_sice(void); // controlls the sice of temp array |
MarcelPortmann | 1:33fdaabcdeda | 52 | struct posdata temp; // temporary data storage |
MarcelPortmann | 1:33fdaabcdeda | 53 | |
MarcelPortmann | 0:ad924d8a2f98 | 54 | // objekte von display,memory,position // für interaktion mit anderen Klassen |
MarcelPortmann | 0:ad924d8a2f98 | 55 | |
MarcelPortmann | 0:ad924d8a2f98 | 56 | }; |
MarcelPortmann | 0:ad924d8a2f98 | 57 | |
MarcelPortmann | 0:ad924d8a2f98 | 58 | #endif |
MarcelPortmann | 0:ad924d8a2f98 | 59 | |
MarcelPortmann | 0:ad924d8a2f98 | 60 | |
MarcelPortmann | 0:ad924d8a2f98 | 61 | |
MarcelPortmann | 0:ad924d8a2f98 | 62 | |
MarcelPortmann | 0:ad924d8a2f98 | 63 |