tortuga DataLogging Library: battery, speed, time, average...
Fork of DataLogging by
BikeData.h@3:610ace66d7af, 2016-07-12 (annotated)
- Committer:
- ptuytsch
- Date:
- Tue Jul 12 11:54:41 2016 +0000
- Revision:
- 3:610ace66d7af
- Parent:
- 2:f3c2bf5521e5
- Child:
- 5:fad416fb6979
same as before
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 | 3:610ace66d7af | 30 | uint8_t getLastCount(void); |
ptuytsch | 3:610ace66d7af | 31 | bool isLogging(); |
ptuytsch | 2:f3c2bf5521e5 | 32 | |
ptuytsch | 2:f3c2bf5521e5 | 33 | enum{ |
ptuytsch | 2:f3c2bf5521e5 | 34 | OVERALL = 0, |
ptuytsch | 2:f3c2bf5521e5 | 35 | TRIP = 1, |
ptuytsch | 2:f3c2bf5521e5 | 36 | BATCHANGE = 2 |
ptuytsch | 2:f3c2bf5521e5 | 37 | }; |
ptuytsch | 2:f3c2bf5521e5 | 38 | }; |
ptuytsch | 2:f3c2bf5521e5 | 39 | |
ptuytsch | 2:f3c2bf5521e5 | 40 | #endif |