tortuga DataLogging Library: battery, speed, time, average...
Fork of DataLogging by
BikeData.h@6:9079496c6e25, 2016-07-18 (annotated)
- Committer:
- ptuytsch
- Date:
- Mon Jul 18 13:18:07 2016 +0000
- Revision:
- 6:9079496c6e25
- Parent:
- 5:fad416fb6979
minor changes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ptuytsch | 2:f3c2bf5521e5 | 1 | #ifndef BIKEDATA_H |
ptuytsch | 2:f3c2bf5521e5 | 2 | #define BIKEDATA_H |
ptuytsch | 2:f3c2bf5521e5 | 3 | #include "mbed.h" |
ptuytsch | 2:f3c2bf5521e5 | 4 | #include "Data.h" |
ptuytsch | 2:f3c2bf5521e5 | 5 | |
ptuytsch | 2:f3c2bf5521e5 | 6 | class BikeData{ |
ptuytsch | 2:f3c2bf5521e5 | 7 | protected: |
ptuytsch | 2:f3c2bf5521e5 | 8 | InterruptIn button; |
ptuytsch | 2:f3c2bf5521e5 | 9 | Ticker tick; |
ptuytsch | 2:f3c2bf5521e5 | 10 | Data *overallData; |
ptuytsch | 2:f3c2bf5521e5 | 11 | Data *tripData; |
ptuytsch | 2:f3c2bf5521e5 | 12 | Data *batChangeData; |
ptuytsch | 2:f3c2bf5521e5 | 13 | Data* dataSet[3]; |
ptuytsch | 3:610ace66d7af | 14 | bool logging; |
ptuytsch | 3:610ace66d7af | 15 | uint8_t count; |
ptuytsch | 3:610ace66d7af | 16 | float lastDistance; |
ptuytsch | 3:610ace66d7af | 17 | uint8_t lastCount; |
ptuytsch | 2:f3c2bf5521e5 | 18 | public: |
ptuytsch | 2:f3c2bf5521e5 | 19 | BikeData(PinName pin); |
ptuytsch | 3:610ace66d7af | 20 | int8_t getBikeNameSize(); |
ptuytsch | 3:610ace66d7af | 21 | void getBikeName(char *name); |
ptuytsch | 3:610ace66d7af | 22 | void setBikeName(char* name,uint8_t length); |
ptuytsch | 2:f3c2bf5521e5 | 23 | void pressed(void); |
ptuytsch | 2:f3c2bf5521e5 | 24 | void interval(void); |
ptuytsch | 2:f3c2bf5521e5 | 25 | Data* getDataSet(uint8_t type); |
ptuytsch | 2:f3c2bf5521e5 | 26 | void startTrip(); |
ptuytsch | 2:f3c2bf5521e5 | 27 | void pauzeTrip(); |
ptuytsch | 2:f3c2bf5521e5 | 28 | void stopTrip(); |
ptuytsch | 3:610ace66d7af | 29 | float getSpeed(void); |
ptuytsch | 5:fad416fb6979 | 30 | float getRPM(); |
ptuytsch | 3:610ace66d7af | 31 | uint8_t getLastCount(void); |
ptuytsch | 3:610ace66d7af | 32 | bool isLogging(); |
ptuytsch | 2:f3c2bf5521e5 | 33 | |
ptuytsch | 2:f3c2bf5521e5 | 34 | enum{ |
ptuytsch | 2:f3c2bf5521e5 | 35 | OVERALL = 0, |
ptuytsch | 2:f3c2bf5521e5 | 36 | TRIP = 1, |
ptuytsch | 2:f3c2bf5521e5 | 37 | BATCHANGE = 2 |
ptuytsch | 2:f3c2bf5521e5 | 38 | }; |
ptuytsch | 2:f3c2bf5521e5 | 39 | }; |
ptuytsch | 2:f3c2bf5521e5 | 40 | |
ptuytsch | 2:f3c2bf5521e5 | 41 | #endif |