コード例 #1
0
        public TrafficLightModel()
        {
            ChangeStateCommand = new ToggleStateCommand();

            _gpio           = GpioController.GetDefault();
            CarTrafficLight = new CarTrafficLight(1, TrafficState.GO, _gpio, 5, 6, 13);

            PedestrianTrafficLight = new PedestrianLight(2, TrafficState.STOP, _gpio, 17, 27, 22);
        }
コード例 #2
0
 public async Task ChangeState()
 {
     CarTrafficLight.ToggleState();
     await PedestrianTrafficLight.ToggleState();
 }