OK. I'm trying to store camera parameters for a cameralink camera in a Python config file, and then pass those parameters on to the camera via a serial port. Does any one know how to do this? This is what I have so far:
Config File
[BAUDRATE]
BAUDRATE = 9600
[ROI]
Width = 16
Height = 16
OffsetX = 3
OffsetY = 3
My code
import configparser
import serial
List_of_Camera_Commands = []
# Establish serial port
'''
ser = serial.Serial('/dev/ttyUSB0')
print(ser.name)
ser.baudrate = 192000
ser.write(stuff to write)
ser.read()
'''
CameraConfig = configparser.ConfigParser()
CameraConfig.read("CameraConfig.conf")
#---------Code to read in Config file Options and cast as ints----
for name in CameraConfig.sections():
for option in CameraConfig.options(name):
Number_Value = CameraConfig.getint(name, option)
print(name, ": ", Number_Value)
Temp_command = [name, Number_Value]
List_of_Camera_Commands.append(Temp_command)
print(List_of_Camera_Commands)
#ser.write(List_of_Camera_Commands) ------> write to serial?