Work on client

This commit is contained in:
Elena Arenskötter 2023-11-04 13:51:51 +01:00
parent 53774cae46
commit 4678656e0f
4 changed files with 5 additions and 7 deletions

View File

@ -229,7 +229,7 @@ class MAX11270:
# Set chip select high to end the read process # Set chip select high to end the read process
GPIO.output(self.csPin, GPIO.HIGH) GPIO.output(self.csPin, GPIO.HIGH)
print(bin(retVal)) #print(bin(retVal))
return retVal return retVal
def _spi_write(self,adc_command): def _spi_write(self,adc_command):

View File

@ -59,11 +59,8 @@ class MCP3204():
# Read 1 data bit # Read 1 data bit
if GPIO.input(self.misoPin): if GPIO.input(self.misoPin):
retVal |= 0x1 retVal |= (1<<(7-bit))
# Advance input to next bit
retVal <<= 1
self._toggleClock() self._toggleClock()
ret.append(retVal) ret.append(retVal)
# get the 24b out of the return # get the 24b out of the return

View File

@ -10,7 +10,7 @@ import pin as GPIO
GPIO.config('./config.json') GPIO.config('./config.json')
import MAX11270 as adc import MAX11270 as adc
import mcp4822 as dac import MCP4822 as dac
import PID as pid import PID as pid
import tcptools as TCP import tcptools as TCP
import spithread as SPIThread import spithread as SPIThread

View File

@ -89,7 +89,8 @@ def spithread(adc, dac):
if msg[1] <= 1: if msg[1] <= 1:
if msg[2] <= 1: if msg[2] <= 1:
if msg[2] == 1: if msg[2] == 1:
voltage = float(msg[4]) - dac[msg[1]].nullVoltage #voltage = float(msg[4]) - dac[msg[1]].nullVoltage
voltage = float(msg[4]) #- dac[msg[1]].nullVoltage
T = dac[msg[1]].write(voltage,msg[2]) T = dac[msg[1]].write(voltage,msg[2])
else: else:
T = dac[msg[1]].write(float(msg[4]),msg[2]) T = dac[msg[1]].write(float(msg[4]),msg[2])