初始化提交

This commit is contained in:
王立帮
2024-07-20 22:09:06 +08:00
commit c247dd07a6
6876 changed files with 2743096 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
#ifndef __RTCTEMPERATURE_H__
#define __RTCTEMPERATURE_H__
class RtcTemperature
{
public:
RtcTemperature(int8_t degrees, uint8_t fraction) :
integerDegrees(degrees),
decimalFraction(fraction)
{
}
float AsFloat()
{
float degrees = (float)integerDegrees;
degrees += (float)decimalFraction / ((degrees < 0) ? -100.0f : 100.0f) ;
return degrees;
}
int8_t AsWholeDegrees()
{
return integerDegrees;
}
uint8_t GetFractional()
{
return decimalFraction;
}
protected:
int8_t integerDegrees;
uint8_t decimalFraction;
};
#endif // __RTCTEMPERATURE_H__