Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SX1276Lib AdaFruit_RGBLCD MCP23017 mbed
Fork of AdaFruit_RGBLCD by
Diff: Modules/TempModule.cpp
- Revision:
- 11:96146db429de
- Parent:
- 10:3fcab08717fc
- Child:
- 13:9641bc42db92
--- a/Modules/TempModule.cpp Sun Aug 10 12:34:44 2014 +0000
+++ b/Modules/TempModule.cpp Sun Aug 10 15:45:03 2014 +0000
@@ -5,13 +5,37 @@
TempModule::TempModule(Adafruit_RGBLCDShield & in_cLCD)
: Module(in_cLCD)
+ , m_nTemp(28)
{
}
TempModule::~TempModule()
{
}
+
+void TempModule::change
+(
+ int in_nIndexX,
+ int in_nCursorY,
+ bool in_bUp
+)
+{
+ enum ETemp
+ {
+ eTens = 0,
+ eSingles = 1,
+ };
+ switch (in_nIndexX)
+ {
+ case eTens: m_nTemp += (in_bUp ? 1 : -1) * 10; break;
+ case eSingles: m_nTemp += (in_bUp ? 1 : -1); break;
+ }
+
+ if (m_nTemp > 40) m_nTemp = 40;
+ if (m_nTemp < -40) m_nTemp = -40;
+}
+
int TempModule::setCursor
(
int in_nIndex,
@@ -33,5 +57,5 @@
void TempModule::show()
{
- m_cLCD.printf("Room: %i%cC ",28,eDegree);
+ m_cLCD.printf("Room: %i%cC ",m_nTemp,eDegree);
}
