Skip to content
Snippets Groups Projects
Commit 2df3a98a authored by thiebolt's avatar thiebolt
Browse files

SCD4x integration is over --> sensor operational :)

parent fcf267dc
Branches
Tags
No related merge requests found
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
*/ */
#define BOARD_NAME "neOSensor" #define BOARD_NAME "neOSensor"
#define BOARD_REVISION 1.2 #define BOARD_REVISION 1.2
#define BOARD_FWREV 220314 // Firmware revision <year><month><day> in 2 digits each #define BOARD_FWREV 220316 // Firmware revision <year><month><day> in 2 digits each
/* ############################################################################# /* #############################################################################
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
@section HISTORY @section HISTORY
F.Thiebolt mar.22 change order (airquality before luminosity)
2021-Nov - F.Thiebolt clear display in destructor 2021-Nov - F.Thiebolt clear display in destructor
2021-Sep - F.Thiebolt considering 1.3 inches oleds based on SH1106 2021-Sep - F.Thiebolt considering 1.3 inches oleds based on SH1106
2020-Nov - F.Thiebolt Initial Release 2020-Nov - F.Thiebolt Initial Release
...@@ -359,16 +360,16 @@ uint8_t oled13inch::dispTime( uint8_t hours, uint8_t minutes, uint8_t seconds ) ...@@ -359,16 +360,16 @@ uint8_t oled13inch::dispTime( uint8_t hours, uint8_t minutes, uint8_t seconds )
} }
{ {
const char *_key = PSTR("luminosity"); const char *_key = PSTR("airquality");
if( strncmp_P(kv.key().c_str(), _key, strlen_P(_key))==0 ) { if( strncmp_P(kv.key().c_str(), _key, strlen_P(_key))==0 ) {
// luminosity // airquality
//serializeJsonPretty( kv.value(), Serial ); //serializeJsonPretty( kv.value(), Serial );
for( JsonPair _kv : (kv.value()).as<JsonObject>() ) { for( JsonPair _kv : (kv.value()).as<JsonObject>() ) {
//log_debug(F("\n[oled13inch][luminosity] key: ")); log_debug(_kv.key().c_str()); log_flush(); //log_debug(F("\n[oled13inch][airquality] key: ")); log_debug(_kv.key().c_str()); log_flush();
const char *_key2avoid = PSTR("value_units"); const char *_key2avoid = PSTR("value_units");
//if( strncmp_P(_kv.key().c_str(), _key2avoid, strlen_P(_key2avoid))!=0 ) { //if( strncmp_P(_kv.key().c_str(), _key2avoid, strlen_P(_key2avoid))!=0 ) {
if( strstr_P(_kv.key().c_str(), _key2avoid)==nullptr ) { if( strstr_P(_kv.key().c_str(), _key2avoid)==nullptr ) {
//snprintf( _str, sizeof(_str), "%dlux", _kv.value().as<int>()); //snprintf( _str, sizeof(_str), "%s:%dµg/m3", _kv.key().c_str(), _kv.value().as<int>());
snprintf( _str, sizeof(_str), "%d%s", _kv.value().as<int>(), _getUnits( _kv.key().c_str(), (kv.value()).as<JsonObject>() ) ); snprintf( _str, sizeof(_str), "%d%s", _kv.value().as<int>(), _getUnits( _kv.key().c_str(), (kv.value()).as<JsonObject>() ) );
_u8g2->drawUTF8(x_offset, y_offset, _str); _u8g2->drawUTF8(x_offset, y_offset, _str);
y_offset += (str_height + 0); y_offset += (str_height + 0);
...@@ -381,16 +382,16 @@ uint8_t oled13inch::dispTime( uint8_t hours, uint8_t minutes, uint8_t seconds ) ...@@ -381,16 +382,16 @@ uint8_t oled13inch::dispTime( uint8_t hours, uint8_t minutes, uint8_t seconds )
} }
{ {
const char *_key = PSTR("airquality"); const char *_key = PSTR("luminosity");
if( strncmp_P(kv.key().c_str(), _key, strlen_P(_key))==0 ) { if( strncmp_P(kv.key().c_str(), _key, strlen_P(_key))==0 ) {
// airquality // luminosity
//serializeJsonPretty( kv.value(), Serial ); //serializeJsonPretty( kv.value(), Serial );
for( JsonPair _kv : (kv.value()).as<JsonObject>() ) { for( JsonPair _kv : (kv.value()).as<JsonObject>() ) {
//log_debug(F("\n[oled13inch][airquality] key: ")); log_debug(_kv.key().c_str()); log_flush(); //log_debug(F("\n[oled13inch][luminosity] key: ")); log_debug(_kv.key().c_str()); log_flush();
const char *_key2avoid = PSTR("value_units"); const char *_key2avoid = PSTR("value_units");
//if( strncmp_P(_kv.key().c_str(), _key2avoid, strlen_P(_key2avoid))!=0 ) { //if( strncmp_P(_kv.key().c_str(), _key2avoid, strlen_P(_key2avoid))!=0 ) {
if( strstr_P(_kv.key().c_str(), _key2avoid)==nullptr ) { if( strstr_P(_kv.key().c_str(), _key2avoid)==nullptr ) {
//snprintf( _str, sizeof(_str), "%s:%dµg/m3", _kv.key().c_str(), _kv.value().as<int>()); //snprintf( _str, sizeof(_str), "%dlux", _kv.value().as<int>());
snprintf( _str, sizeof(_str), "%d%s", _kv.value().as<int>(), _getUnits( _kv.key().c_str(), (kv.value()).as<JsonObject>() ) ); snprintf( _str, sizeof(_str), "%d%s", _kv.value().as<int>(), _getUnits( _kv.key().c_str(), (kv.value()).as<JsonObject>() ) );
_u8g2->drawUTF8(x_offset, y_offset, _str); _u8g2->drawUTF8(x_offset, y_offset, _str);
y_offset += (str_height + 0); y_offset += (str_height + 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment