コード例 #1
0
ファイル: Robot.py プロジェクト: Henning-Klatt/Robotics-AG
    def __init__(self):
        # Load configuration file
        with open("config.yml",
                  'r') as ymlfile:  # Load Configuration into Dict
            cfg = yaml.load(ymlfile)
        for section in cfg['robot']:
            setattr(self, section, cfg['robot'][section])

        # Init vars for values
        self.light = [0] * 8  # Contains sensorbar values
        self.colors = [0] * 2
        self.lightCalibrate = [
            150
        ] * 8  # Contains treshold, modified by Robot.Calibrate

        # Setup
        #-------------------------------
        # Arduino
        self.arduino = Arduino.arduino()

        # BrickPi
        self.brick = BrickPi(unsafe=self.unsafe)
        sleep(5)
コード例 #2
0
ファイル: System.py プロジェクト: Henning-Klatt/Robotics-AG
 def __init__(self):
     self.mainThread = []
     self.arduino = Arduino.arduino()