Beispiel #1
0
        /// <summary>
        /// Initialize <see cref="ExplorerHat"/> instance
        /// </summary>
        public ExplorerHat(GpioController?controller = null, bool shouldDispose = true)
        {
            _shouldDispose = shouldDispose || controller is null;
            _controller    = controller ?? new GpioController();

            Motors = new Motors(_controller);
            Lights = new Lights(_controller);
        }
Beispiel #2
0
        /// <summary>
        /// Initialize <see cref="ExplorerHat"/> instance
        /// </summary>
        public ExplorerHat(GpioController controller = null, bool shouldDispose = true)
        {
            _controller    = controller;
            _shouldDispose = controller == null ? true : shouldDispose;

            _controller = controller ?? new GpioController();

            Motors = new Motors(_controller);
            Lights = new Lights(_controller);
        }