コード例 #1
0
        public SerialCarHardwareInterface(String portPath)
        {
            // For now, we're hardcoding our sensors.
            RearUltrasonicSensor = new UltrasonicSensor();
            FrontUltrasonicSensors = new UltrasonicSensor[] {
                new UltrasonicSensor(),
                new UltrasonicSensor(),
                new UltrasonicSensor()
            };
            Accelerometor = new AccelerometorSensor();
            ThrottleServo = new Servo(this);
            SteeringServo = new Servo(this);

            StartSerialPortConnection();
        }
コード例 #2
0
 public DistancesInfoScreen([ReadOnlyArray()] UltrasonicSensor[] frontSensors, UltrasonicSensor rearSensor)
 {
     FrontSensors = (UltrasonicSensor[])frontSensors.Clone();
     RearSensor = rearSensor;
 }