in the main sketch change this
void loop()
{
Serial.println("Loop");
float t = czr.Celsius();
float f = czr.Fahrenheit();
float h = czr.Humidity();
uint32_t c = czr.CO2();
Serial.print("Celcius = ");Serial.println(t);
Serial.print("Fahrenheit = ");Serial.println(f);
Serial.print("Humidity = ");Serial.println(h);
Serial.print("CO2 = ");Serial.println(c);
delay(3000);
}
in cozir.h change this
uint32_t CO2();
in cozir.cpp change this
uint32_t COZIR::CO2()
{
return Request("Z");
}
and
uint32_t COZIR::Request(const char* s)
{
Command(s);
// empty buffer
buffer[0] = '\0';
// read answer; there may be a 100ms delay!
// TODO: PROPER TIMEOUT CODE.
delay(200);
int idx = 0;
while(CZR_Serial.available())
{
buffer[idx++] = CZR_Serial.read();
}
buffer[idx] = '\0';
uint32_t rv = 0;
switch(buffer[0])
{
case 'T' :
rv = atoi(&buffer[5]);
if (buffer[4] == 1) rv += 1000;
// negative values are mapped above 1000..1250 => capture this in Celsius()
break;
default :
rv = atol(&buffer[2]);
break;
}
return rv;
}
and change the version number to 0.1.04 if it works