feat: 全量同步 254 个常用的 Arduino 扩展库文件

This commit is contained in:
yczpf2019
2026-01-24 16:05:38 +08:00
parent c665ba662b
commit 397b9a23a3
6878 changed files with 2732224 additions and 1 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__