changes
This commit is contained in:
parent
a8d1708512
commit
0c111dd818
@ -24,6 +24,7 @@
|
|||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/ThermometerPro/arduino/core}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/ThermometerPro/arduino/core}""/>
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/ThermometerPro/arduino/variant}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/ThermometerPro/arduino/variant}""/>
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/ThermometerPro/Libraries/SPI}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/ThermometerPro/Libraries/SPI}""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc:/ThermometerPro/Libraries/NilRTOS}""/>
|
||||||
</option>
|
</option>
|
||||||
<inputType id="it.baeyens.arduino.compiler.cpp.sketch.input.244106961" name="CPP source files" superClass="it.baeyens.arduino.compiler.cpp.sketch.input"/>
|
<inputType id="it.baeyens.arduino.compiler.cpp.sketch.input.244106961" name="CPP source files" superClass="it.baeyens.arduino.compiler.cpp.sketch.input"/>
|
||||||
</tool>
|
</tool>
|
||||||
@ -32,6 +33,7 @@
|
|||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/ThermometerPro/arduino/core}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/ThermometerPro/arduino/core}""/>
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/ThermometerPro/arduino/variant}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/ThermometerPro/arduino/variant}""/>
|
||||||
<listOptionValue builtIn="false" value=""${workspace_loc:/ThermometerPro/Libraries/SPI}""/>
|
<listOptionValue builtIn="false" value=""${workspace_loc:/ThermometerPro/Libraries/SPI}""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc:/ThermometerPro/Libraries/NilRTOS}""/>
|
||||||
</option>
|
</option>
|
||||||
<inputType id="it.baeyens.arduino.compiler.c.sketch.input.1503729033" name="C Source Files" superClass="it.baeyens.arduino.compiler.c.sketch.input"/>
|
<inputType id="it.baeyens.arduino.compiler.c.sketch.input.1503729033" name="C Source Files" superClass="it.baeyens.arduino.compiler.c.sketch.input"/>
|
||||||
</tool>
|
</tool>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "ThermometerPro.h"
|
#include "ThermometerPro.h"
|
||||||
|
|
||||||
|
|
||||||
#include "AD7190.h"
|
#include "AD7190.h"
|
||||||
#include "cmd.h"
|
#include "cmd.h"
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
@ -12,14 +11,11 @@ static TestCmd testCmd;
|
|||||||
static Uptime uptime;
|
static Uptime uptime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
cmdServer.begin();
|
cmdServer.begin();
|
||||||
testCmd.registerYourself(&cmdServer);
|
testCmd.registerYourself(&cmdServer);
|
||||||
uptime.begin(&cmdServer);
|
uptime.begin(&cmdServer);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
|
||||||
delay(5000);
|
delay(5000);
|
||||||
@ -62,11 +58,11 @@ float pt1000(float r) {
|
|||||||
|
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|
||||||
cmdServer.exec();
|
cmdServer.exec();
|
||||||
uptime.exec();
|
uptime.exec();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Serial.print("Tick\n");
|
Serial.print("Tick\n");
|
||||||
|
|
||||||
AD7190_ChannelSelect(AD7190_CH_AIN4P_AINCOM);
|
AD7190_ChannelSelect(AD7190_CH_AIN4P_AINCOM);
|
||||||
@ -125,4 +121,5 @@ void loop() {
|
|||||||
|
|
||||||
|
|
||||||
delay(1000);
|
delay(1000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,18 @@
|
|||||||
|
|
||||||
#include <WString.h>
|
#include <WString.h>
|
||||||
#include "uptime.h"
|
#include "uptime.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
UptimeCmd::UptimeCmd(Uptime *uptime) : m_uptime(uptime) {
|
UptimeCmd::UptimeCmd(Uptime *uptime) : m_uptime(uptime) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String UptimeCmd::exec(String params) {
|
String UptimeCmd::exec(String params) {
|
||||||
return m_uptime->getDays() + String(" ") +
|
String res = m_uptime->getDays() + String(" ") +
|
||||||
m_uptime->getHours() + String(":") + m_uptime->getMinutes() + String(":") + m_uptime->getSeconds();
|
m_uptime->getHours() + String(":") + m_uptime->getMinutes() + String(":") + m_uptime->getSeconds();
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
Uptime::Uptime() : m_uptimeCmd(this), m_seconds(0), m_minutes(0), m_hours(0), m_days(0) {
|
Uptime::Uptime() : m_uptimeCmd(this), m_seconds(0), m_minutes(0), m_hours(0), m_days(0) {
|
||||||
@ -24,6 +28,7 @@ void Uptime::begin(CmdServer *cmdServer) {
|
|||||||
void Uptime::exec() {
|
void Uptime::exec() {
|
||||||
static unsigned long lastMillis = 0;
|
static unsigned long lastMillis = 0;
|
||||||
|
|
||||||
|
|
||||||
unsigned long currentMillis = millis();
|
unsigned long currentMillis = millis();
|
||||||
if (currentMillis >= (lastMillis + 1000)) {
|
if (currentMillis >= (lastMillis + 1000)) {
|
||||||
m_seconds += ((currentMillis - lastMillis) / 1000);
|
m_seconds += ((currentMillis - lastMillis) / 1000);
|
||||||
@ -42,4 +47,5 @@ void Uptime::exec() {
|
|||||||
|
|
||||||
lastMillis = currentMillis;
|
lastMillis = currentMillis;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user