diff --git a/circuitdesign/distribution_board.fzz b/circuitdesign/distribution_board.fzz index be10f0b..d345986 100644 Binary files a/circuitdesign/distribution_board.fzz and b/circuitdesign/distribution_board.fzz differ diff --git a/fetchprogram b/fetchprogram new file mode 100755 index 0000000..e84dc27 --- /dev/null +++ b/fetchprogram @@ -0,0 +1,26 @@ +#!/usr/bin/python3 + +import os, sys +lib_path = os.path.abspath(os.path.join('..', 'modules')) +sys.path.append(lib_path) +import hdc1000 +import weight +hdc1000.init() + +while True: + sleep(60) + try: + temp = hdc.temperature() + except: + pass + try: + humid = hdc.humidity() + except: + pass + try: + weight = weight.readchannel(7) + except: + pass + +hdc1000.done() + diff --git a/testprograms/spitest b/modules/weight old mode 100755 new mode 100644 similarity index 100% rename from testprograms/spitest rename to modules/weight diff --git a/testprograms/weighttest b/testprograms/weighttest new file mode 100755 index 0000000..090d5f8 --- /dev/null +++ b/testprograms/weighttest @@ -0,0 +1,17 @@ +#!/usr/bin/python + +import spidev +import time +import os + +spi = spidev.SpiDev() +spi.open(0, 0) + +def readchannel(channel): + adc = spi.xfer2([1, (8+channel)<<4, 0]) + data = ((adc[1]&3)<<8) + adc[2] + return data + +while True: + print(readchannel(7)) + time.sleep(.5)