-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from kadaan/Reduce_instantiation
Reduce instantiation
- Loading branch information
Showing
20 changed files
with
728 additions
and
529 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#pragma once | ||
|
||
#include <Arduino.h> | ||
#include "SensorData.h" | ||
|
||
class CyclePowerData : public SensorData | ||
{ | ||
public: | ||
CyclePowerData() : SensorData("CPS"){}; | ||
|
||
bool hasHeartRate(); | ||
bool hasCadence(); | ||
bool hasPower(); | ||
bool hasSpeed(); | ||
int getHeartRate(); | ||
float getCadence(); | ||
int getPower(); | ||
float getSpeed(); | ||
void decode(uint8_t *data, size_t length); | ||
|
||
private: | ||
int power; | ||
float cadence; | ||
float crankRev = 0; | ||
float lastCrankRev = 0; | ||
float lastCrankEventTime = 0; | ||
float crankEventTime = 0; | ||
uint8_t missedReadingCount = 0; | ||
}; |
Oops, something went wrong.