diff --git a/src/CO2Sensor.cpp b/src/CO2Sensor.cpp index c1a204a..e3d5d94 100644 --- a/src/CO2Sensor.cpp +++ b/src/CO2Sensor.cpp @@ -53,7 +53,7 @@ int CO2Sensor::read(){ if (_co2ppmCO2_HIGHT) _greenLevel = 0; - else _greenLevel = map(_co2ppm, CO2_LOW, CO2_HIGHT, 255, 0); + else _greenLevel = map((int)_co2ppm, CO2_LOW, CO2_HIGHT, 255, 0); } return _co2ppm;