Get sensor values (CO2, humidity, and temperature) from UD-CO2S. The source code currently assumes that the device is available as /dev/tty.usbmodemXXXX
.
# Build
go build co2monitor.go
# Run
./co2monitor
# To stop, press ctrl-c
$ ./co2monitor
{
"co2": 699,
"hum": 46.7,
"temp": 30.8
}
{
"co2": 699,
"hum": 46.7,
"temp": 30.8
}
{
"co2": 699,
"hum": 46.6,
"temp": 30.7
}