Arduino oop adding functions from the original aduino code
This commit is contained in:
@@ -18,9 +18,6 @@ void nodeReadings::setup(){
|
||||
|
||||
pinMode(MICPIN, INPUT);
|
||||
pinMode(DHTPIN, INPUT);
|
||||
|
||||
websocketSetup();
|
||||
resetValues();
|
||||
|
||||
}
|
||||
|
||||
@@ -38,8 +35,6 @@ void nodeReadings::loop() {
|
||||
currentMillis = millis();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void nodeReadings::resetValues() {
|
||||
counter = 0;
|
||||
eCO2 = 0;
|
||||
@@ -51,4 +46,18 @@ void nodeReadings::resetValues() {
|
||||
errorSGP30 = false;
|
||||
errorDHT11 = false;
|
||||
noise = false;
|
||||
}
|
||||
|
||||
// hexdump function for websockets binary handler
|
||||
void hexdump(const void *mem, uint32_t len, uint8_t cols = 16) {
|
||||
const uint8_t* src = (const uint8_t*) mem;
|
||||
USE_SERIAL.printf("\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (ptrdiff_t)src, len, len);
|
||||
for(uint32_t i = 0; i < len; i++) {
|
||||
if(i % cols == 0) {
|
||||
USE_SERIAL.printf("\n[0x%08X] 0x%08X: ", (ptrdiff_t)src, i);
|
||||
}
|
||||
USE_SERIAL.printf("%02X ", *src);
|
||||
src++;
|
||||
}
|
||||
USE_SERIAL.printf("\n");
|
||||
}
|
Reference in New Issue
Block a user