Work on client
This commit is contained in:
parent
53774cae46
commit
4678656e0f
@ -229,7 +229,7 @@ class MAX11270:
|
||||
# Set chip select high to end the read process
|
||||
GPIO.output(self.csPin, GPIO.HIGH)
|
||||
|
||||
print(bin(retVal))
|
||||
#print(bin(retVal))
|
||||
return retVal
|
||||
|
||||
def _spi_write(self,adc_command):
|
||||
|
||||
@ -59,10 +59,7 @@ class MCP3204():
|
||||
|
||||
# Read 1 data bit
|
||||
if GPIO.input(self.misoPin):
|
||||
retVal |= 0x1
|
||||
|
||||
# Advance input to next bit
|
||||
retVal <<= 1
|
||||
retVal |= (1<<(7-bit))
|
||||
|
||||
self._toggleClock()
|
||||
ret.append(retVal)
|
||||
|
||||
@ -10,7 +10,7 @@ import pin as GPIO
|
||||
GPIO.config('./config.json')
|
||||
|
||||
import MAX11270 as adc
|
||||
import mcp4822 as dac
|
||||
import MCP4822 as dac
|
||||
import PID as pid
|
||||
import tcptools as TCP
|
||||
import spithread as SPIThread
|
||||
|
||||
@ -89,7 +89,8 @@ def spithread(adc, dac):
|
||||
if msg[1] <= 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])
|
||||
else:
|
||||
T = dac[msg[1]].write(float(msg[4]),msg[2])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user