#author("2022-02-07T07:29:50+00:00","","") #author("2022-02-07T07:30:25+00:00","","") RaspberryPiのPythonで観測データをAmbientに送信する * PythonにAmbientライブラリを追加する [#dd271d59] $ sudo pip install git+https://github.com/AmbientDataInc/ambient-python-lib.git * コード [#k0d3ca03] #coding: utf-8 import bme280_temp import bme280_humid import bme280_pres import ambient # Open Ambient cloud ambi = ambient.Ambient(チャンネルID, "ライトキー") T = bme280_temp.readData() H = bme280_humid.readData() P = bme280_pres.readData() # Send to Ambient r = ambi.send({"d1": T, "d2": H, "d3": P}) #coding: utf-8 import bme280_temp import bme280_humid import bme280_pres import ambient # Open Ambient cloud ambi = ambient.Ambient(チャンネルID, "ライトキー") T = bme280_temp.readData() H = bme280_humid.readData() P = bme280_pres.readData() # Send to Ambient r = ambi.send({"d1": T, "d2": H, "d3": P})