Created
October 14, 2018 11:35
-
-
Save benevolent0505/a60634b0f6193cbd3a34d2840f686705 to your computer and use it in GitHub Desktop.
py-co2mini
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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