1
Dependencies: QEI2 chair_BNO055 PID Watchdog VL53L1X_Filter ros_lib_kinetic
Dependents: wheelchairControlSumer2019
Statistics/statistics.h@30:b24d73663499, 2020-06-03 (annotated)
- Committer:
- jvfausto
- Date:
- Wed Jun 03 20:25:18 2020 +0000
- Revision:
- 30:b24d73663499
- Parent:
- 28:6d6bd8ad04dc
For sharing
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jvfausto | 28:6d6bd8ad04dc | 1 | #ifndef statistics_h //improvement: #ifndef _STATISTICS_h (purpose: good coding practice) |
jvfausto | 28:6d6bd8ad04dc | 2 | #define statistics_h // #define _STATISTICS_h |
jvfausto | 27:da718b990837 | 3 | |
jvfausto | 27:da718b990837 | 4 | #include "mbed.h" |
jvfausto | 27:da718b990837 | 5 | |
jvfausto | 28:6d6bd8ad04dc | 6 | // Capitalize the first letter of class name (good coding practice/how to distinguish class from function) |
jvfausto | 27:da718b990837 | 7 | class statistics |
jvfausto | 27:da718b990837 | 8 | { |
jvfausto | 27:da718b990837 | 9 | public: |
jvfausto | 28:6d6bd8ad04dc | 10 | //Defining default constructor |
jvfausto | 27:da718b990837 | 11 | statistics(int* Input, int dataLength, int firstDataPoint = 0); |
jvfausto | 28:6d6bd8ad04dc | 12 | //Defining methods |
jvfausto | 27:da718b990837 | 13 | double stdev(); |
jvfausto | 27:da718b990837 | 14 | double mean(); |
jvfausto | 27:da718b990837 | 15 | |
jvfausto | 27:da718b990837 | 16 | private: |
jvfausto | 28:6d6bd8ad04dc | 17 | int* data; //pointer to data |
jvfausto | 27:da718b990837 | 18 | int dataLength; |
jvfausto | 28:6d6bd8ad04dc | 19 | int firstDataPoint; |
jvfausto | 27:da718b990837 | 20 | |
jvfausto | 27:da718b990837 | 21 | |
jvfausto | 27:da718b990837 | 22 | }; |
jvfausto | 27:da718b990837 | 23 | |
jvfausto | 28:6d6bd8ad04dc | 24 | #endif |