![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Where we will test the side ToF sensors
Dependencies: QEI2 PID Watchdog VL53L1X_Filter ros_lib_kinetic
wheelchairControlSideTof/Statistics/statistics.h@18:a10277a63b53, 2019-07-02 (annotated)
- Committer:
- isagmz
- Date:
- Tue Jul 02 17:27:51 2019 +0000
- Revision:
- 18:a10277a63b53
for debugging, added comments
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
isagmz | 18:a10277a63b53 | 1 | #ifndef statistics_h //improvement: #ifndef _STATISTICS_h (purpose: good coding practice) |
isagmz | 18:a10277a63b53 | 2 | #define statistics_h // #define _STATISTICS_h |
isagmz | 18:a10277a63b53 | 3 | |
isagmz | 18:a10277a63b53 | 4 | #include "mbed.h" |
isagmz | 18:a10277a63b53 | 5 | |
isagmz | 18:a10277a63b53 | 6 | // Capitalize the first letter of class name (good coding practice/how to distinguish class from function) |
isagmz | 18:a10277a63b53 | 7 | class statistics |
isagmz | 18:a10277a63b53 | 8 | { |
isagmz | 18:a10277a63b53 | 9 | public: |
isagmz | 18:a10277a63b53 | 10 | //Defining default constructor |
isagmz | 18:a10277a63b53 | 11 | statistics(int* Input, double dataLength, int firstDataPoint = 0); |
isagmz | 18:a10277a63b53 | 12 | //Defining methods |
isagmz | 18:a10277a63b53 | 13 | double stdev(); |
isagmz | 18:a10277a63b53 | 14 | double mean(); |
isagmz | 18:a10277a63b53 | 15 | |
isagmz | 18:a10277a63b53 | 16 | private: |
isagmz | 18:a10277a63b53 | 17 | int* data; //pointer to data |
isagmz | 18:a10277a63b53 | 18 | double dataLength; |
isagmz | 18:a10277a63b53 | 19 | int firstDataPoint; |
isagmz | 18:a10277a63b53 | 20 | |
isagmz | 18:a10277a63b53 | 21 | |
isagmz | 18:a10277a63b53 | 22 | }; |
isagmz | 18:a10277a63b53 | 23 | |
isagmz | 18:a10277a63b53 | 24 | #endif |