Add files via upload
This commit is contained in:
10
src/main.cpp
10
src/main.cpp
@@ -25,8 +25,10 @@ WiFiUDP ntpUDP;
|
|||||||
NTPClient timeClient(ntpUDP, "gr.pool.ntp.org", 0, 1296000000);
|
NTPClient timeClient(ntpUDP, "gr.pool.ntp.org", 0, 1296000000);
|
||||||
Adafruit_BME280 bme;
|
Adafruit_BME280 bme;
|
||||||
|
|
||||||
void serialDebugInfo(float batteryVoltage, float batteryPrecentage, int wifiRSSI, int wifiStatus, const char* day, bool brightness, float temperature, float humidity, float pressure, bool disconnected)
|
void serialDebugInfo(float firmwareVersion, float batteryVoltage, float batteryPrecentage, int wifiRSSI, int wifiStatus, const char* day, bool brightness, float temperature, float humidity, float pressure, bool disconnected)
|
||||||
{
|
{
|
||||||
|
Serial1.print("Firmware Version: ");
|
||||||
|
Serial1.println(firmwareVersion, 1);
|
||||||
Serial1.print("Battery Voltage: ");
|
Serial1.print("Battery Voltage: ");
|
||||||
Serial1.println(batteryVoltage, 1);
|
Serial1.println(batteryVoltage, 1);
|
||||||
Serial1.print("Battery Precentage: ");
|
Serial1.print("Battery Precentage: ");
|
||||||
@@ -375,7 +377,7 @@ void setup()
|
|||||||
{
|
{
|
||||||
Serial1.setTX(0);
|
Serial1.setTX(0);
|
||||||
Serial1.setRX(1);
|
Serial1.setRX(1);
|
||||||
Serial1.begin(9600);
|
Serial1.begin(115200);
|
||||||
debugmode = true;
|
debugmode = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -383,7 +385,7 @@ void setup()
|
|||||||
void loop()
|
void loop()
|
||||||
{
|
{
|
||||||
static bool disconnected = false;
|
static bool disconnected = false;
|
||||||
static int counter = 0;
|
static int counter = 29;
|
||||||
timeClient.update();
|
timeClient.update();
|
||||||
|
|
||||||
const char* day = getDay(timeClient.getDay());
|
const char* day = getDay(timeClient.getDay());
|
||||||
@@ -401,7 +403,7 @@ void loop()
|
|||||||
if (debugmode == true && counter >= 30)
|
if (debugmode == true && counter >= 30)
|
||||||
{
|
{
|
||||||
float pressure = bme.readPressure();
|
float pressure = bme.readPressure();
|
||||||
serialDebugInfo(batteryVoltage, batteryPrecentage, wifiRSSI, wifiStatus, day, brightness, temperature, humidity, pressure, disconnected);
|
serialDebugInfo(2.2 ,batteryVoltage, batteryPrecentage, wifiRSSI, wifiStatus, day, brightness, temperature, humidity, pressure, disconnected);
|
||||||
counter = 0;
|
counter = 0;
|
||||||
}
|
}
|
||||||
counter++;
|
counter++;
|
||||||
|
|||||||
Reference in New Issue
Block a user