- use better config
git-svn-id: http://moon:8086/svn/projects/HendiControl@145 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
@@ -44,7 +44,7 @@ if __name__ == '__main__':
|
|||||||
plant_class = globals()[configJson["Controller"]['plant_name']]
|
plant_class = globals()[configJson["Controller"]['plant_name']]
|
||||||
plant = plant_class(configJson["WaterSim"])
|
plant = plant_class(configJson["WaterSim"])
|
||||||
ruehrer_class = globals()[configJson["Controller"]['stirrer_name']]
|
ruehrer_class = globals()[configJson["Controller"]['stirrer_name']]
|
||||||
ruehrer = ruehrer_class(configJson["Controller"]['dt'])
|
ruehrer = ruehrer_class(configJson["Stirrer"])
|
||||||
|
|
||||||
ablauf = Controller(configJson["Controller"], plant, ruehrer)
|
ablauf = Controller(configJson["Controller"], plant, ruehrer)
|
||||||
|
|
||||||
|
|||||||
@@ -5,13 +5,14 @@ import serial
|
|||||||
|
|
||||||
|
|
||||||
class Pololu1376(AStirrer):
|
class Pololu1376(AStirrer):
|
||||||
def __init__(self, dt, com_port='/dev/ttyUSB0', com_baud=9600):
|
def __init__(self, params):
|
||||||
super(Pololu1376, self).__init__(dt)
|
super(Pololu1376, self).__init__(params["dt"])
|
||||||
self.isMasterOn = 0
|
self.isMasterOn = 0
|
||||||
|
|
||||||
self.ser = serial.Serial(com_port, com_baud)
|
self.ser_speed = params["speed"]
|
||||||
|
self.ser_port = params["port"]
|
||||||
|
self.ser = serial.Serial(self.ser_port, self.ser_speed)
|
||||||
self.ser.set_output_flow_control(False)
|
self.ser.set_output_flow_control(False)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.ser.open()
|
self.ser.open()
|
||||||
except:
|
except:
|
||||||
|
|||||||
Reference in New Issue
Block a user