Organisation and delete temphumidtest
This commit is contained in:
@@ -39,6 +39,7 @@ def reset(extra = 0):
|
||||
extra
|
||||
)
|
||||
bus.i2c([CONFIG_REG, config >> 8, config & 0xff], 0)
|
||||
time.sleep(0.2)
|
||||
|
||||
def temperature():
|
||||
# Request temperature measurement
|
||||
@@ -79,3 +80,8 @@ def drySensor():
|
||||
def init():
|
||||
reset()
|
||||
|
||||
def done():
|
||||
global bus
|
||||
bus.close()
|
||||
del bus
|
||||
|
||||
|
||||
16
testprograms/temphumidtest
Normal file → Executable file
16
testprograms/temphumidtest
Normal file → Executable file
@@ -1 +1,15 @@
|
||||
tests and stuff
|
||||
#!/usr/bin/python3
|
||||
|
||||
import os, sys
|
||||
lib_path = os.path.abspath(os.path.join('..', 'modules'))
|
||||
sys.path.append(lib_path)
|
||||
|
||||
import hdc1000
|
||||
|
||||
hdc1000.init()
|
||||
|
||||
print("Temperature: %.2f C" % hdc1000.temperature())
|
||||
print("Humidity: %.2f %%" % hdc1000.humidity())
|
||||
|
||||
hdc1000.done()
|
||||
|
||||
|
||||
0
dimensions → wooddesign/dimensions
Normal file → Executable file
0
dimensions → wooddesign/dimensions
Normal file → Executable file
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import math as maths
|
||||
|
||||
Reference in New Issue
Block a user