Esempio n. 1
0
        private async Task Initialize()
        {
            _isActive = true;

            _manager = await PinManager.CreateAsync();

            _ledPin1             = _manager.CreatePin <IGpioOutputPin>(5);
            _ledPin2             = _manager.CreatePin <IGpioOutputPin>(25);
            _ledPin3             = _manager.CreatePin <IGpioOutputPin>(12);
            _button              = new SwitchButton(_manager.CreatePin <IGpioInputPin>(26, DriveMode.InputPullUp));
            _button.ActiveAction = () => { _isActive = !_isActive; };

            _display = new SingleDigitDisplayDevice(_manager.CreatePin <IGpioOutputPin>(17), _manager.CreatePin <IGpioOutputPin>(18), _manager.CreatePin <IGpioOutputPin>(27));

            _servo = new Servo(_manager.CreatePin <IPwmPin>(13));

            _servo.DesiredAngle = 0;

            await _manager.InitializeAsync();
        }