mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 17:31:13 +03:00
mhz16: fixed JS/Python examples to match driver API
Signed-off-by: Zion Orent <zorent@ics.com> Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
66aaa97955
commit
d04f93ffca
@ -56,16 +56,15 @@ print ("Make sure that the sensor has had "
|
||||
"The temperature reported is not the ambient temperature,\n"
|
||||
"but rather the temperature of the sensor elements.")
|
||||
|
||||
gas = upmMhz16.new_intp()
|
||||
temp = upmMhz16.new_intp()
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
while(1):
|
||||
myCO2.getData(gas, temp)
|
||||
outputStr = ("CO2 concentration: {0} PPM, "
|
||||
"Temperature (in C): {1}".format(
|
||||
upmMhz16.intp_value(gas), upmMhz16.intp_value(temp)))
|
||||
print outputStr
|
||||
if (not myCO2.getData()):
|
||||
print "Failed to retrieve data"
|
||||
else:
|
||||
outputStr = ("CO2 concentration: {0} PPM, "
|
||||
"Temperature (in C): {1}".format(
|
||||
myCO2.getGas(), myCO2.getTemperature()))
|
||||
print outputStr
|
||||
|
||||
time.sleep(2)
|
||||
|
Reference in New Issue
Block a user