Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
from CO2Meter import *
import time
from datetime import datetime
sensor = CO2Meter("/dev/hidraw0")
time.sleep(5) # 認識待ち
data = sensor.get_data()
timestamp = int(time.time())
print("co2mini.co2\t{}\t{}".format(data["co2"], timestamp))
print("co2mini.temp\t{}\t{}".format(data["temperature"], timestamp))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment