Esempio n. 1
0
		protected async override Task Initialize(ISocket parentSocket) {
			this.boards = 0;
			this.data = null;

			this.spi = await parentSocket.CreateSpiDeviceAsync(new Windows.Devices.Spi.SpiConnectionSettings(0) { Mode = Windows.Devices.Spi.SpiMode.Mode0, ClockFrequency = 1000 });
			this.enable = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Three, false);
			this.clr = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Four, true);
		}
Esempio n. 2
0
        protected async override Task Initialize(ISocket parentSocket)
        {
            this.red = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Four, false);

            this.green = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Five, false);

            this.blue = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Three, false);
        }
		protected async override Task Initialize(ISocket parentSocket) {
			this.pwms = new PwmOutput[] {
				await parentSocket.CreatePwmOutputAsync(SocketPinNumber.Eight),
				await parentSocket.CreatePwmOutputAsync(SocketPinNumber.Seven)
			};

			this.directions = new DigitalIO[] {
				await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Six, false),
				await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Nine, false)
			};

			this.StopAll();
		}
Esempio n. 4
0
        protected async override Task Initialize(ISocket parentSocket) {
			this.outputPin = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Four, false);
			this.inputPin = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Three, GpioPinEdge.FallingEdge | GpioPinEdge.RisingEdge);

            this.inputPin.ValueChanged += (s, e) => {
                if (e.Value) {
                    this.Released?.Invoke(this, null);
                }
                else {
                    this.Pressed?.Invoke(this, null);
                }
            };
		}
Esempio n. 5
0
        protected async override Task Initialize(ISocket parentSocket)
        {
            this.boards = 0;
            this.data   = null;

            this.spi = await parentSocket.CreateSpiDeviceAsync(new Windows.Devices.Spi.SpiConnectionSettings(0)
            {
                Mode = Windows.Devices.Spi.SpiMode.Mode0, ClockFrequency = 1000
            });

            this.enable = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Three, false);

            this.clr = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Four, true);
        }
Esempio n. 6
0
        protected async override Task Initialize(ISocket parentSocket)
        {
            this.pwms = new PwmOutput[] {
                await parentSocket.CreatePwmOutputAsync(SocketPinNumber.Eight),
                await parentSocket.CreatePwmOutputAsync(SocketPinNumber.Seven)
            };

            this.directions = new DigitalIO[] {
                await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Six, false),
                await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Nine, false)
            };

            this.StopAll();
        }
Esempio n. 7
0
        protected async override Task Initialize(ISocket parentSocket)
        {
            this.x = await parentSocket.CreateAnalogIOAsync(SocketPinNumber.Four);

            this.y = await parentSocket.CreateAnalogIOAsync(SocketPinNumber.Five);

            this.input = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Three);
        }
Esempio n. 8
0
        protected async override Task Initialize(ISocket parentSocket)
        {
            this.outputPin = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Four, false);

            this.inputPin = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Three, GpioPinEdge.FallingEdge | GpioPinEdge.RisingEdge);

            this.inputPin.ValueChanged += (s, e) => {
                if (e.Value)
                {
                    this.Released?.Invoke(this, null);
                }
                else
                {
                    this.Pressed?.Invoke(this, null);
                }
            };
        }
Esempio n. 9
0
        protected async override Task Initialize(ISocket parentSocket)
        {
            this.lcdRS = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Four, false);

            this.lcdE = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Three, false);

            this.lcdD4 = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Five, false);

            this.lcdD5 = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Seven, false);

            this.lcdD6 = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Nine, false);

            this.lcdD7 = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Six, false);

            this.backlight = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Eight, true);

            this.currentRow = 0;

            this.SendCommand(0x33);
            this.SendCommand(0x32);
            this.SendCommand(CharacterDisplay.DisplayOnCommand);
            this.SendCommand(CharacterDisplay.ClearDisplayCommand);

            Task.Delay(3).Wait();
        }
Esempio n. 10
0
        protected async override Task Initialize(ISocket parentSocket)
        {
            this.outputPins = new GSI.DigitalIO[7];

            for (var i = 0; i < 7; i++)
            {
                this.outputPins[i] = await parentSocket.CreateDigitalIOAsync((SocketPinNumber)(i + 3), false);
            }
        }
Esempio n. 11
0
        protected async override Task Initialize(ISocket parentSocket)
        {
            this.P1 = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Three, false);

            this.P2 = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Four, false);

            this.P3 = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Five, false);

            this.P4 = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Six, false);

            this.P5 = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Seven, false);

            this.P6 = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Eight, false);

            this.P7 = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Nine, false);
        }
Esempio n. 12
0
		protected async override Task Initialize(ISocket parentSocket) {
			this.lcdRS = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Four, false);
			this.lcdE = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Three, false);
			this.lcdD4 = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Five, false);
			this.lcdD5 = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Seven, false);
			this.lcdD6 = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Nine, false);
			this.lcdD7 = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Six, false);
			this.backlight = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Eight, true);

			this.currentRow = 0;

			this.SendCommand(0x33);
			this.SendCommand(0x32);
			this.SendCommand(CharacterDisplay.DisplayOnCommand);
			this.SendCommand(CharacterDisplay.ClearDisplayCommand);

			Task.Delay(3).Wait();
		}
Esempio n. 13
0
		protected async override Task Initialize(ISocket parentSocket) {
			this.x = await parentSocket.CreateAnalogIOAsync(SocketPinNumber.Four);
			this.y = await parentSocket.CreateAnalogIOAsync(SocketPinNumber.Five);
			this.input = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Three);
		}
Esempio n. 14
0
		protected async override Task Initialize(ISocket parentSocket) {
			this.outputPins = new DigitalIO[7];

			for (var i = 0; i < 7; i++)
				this.outputPins[i] = await parentSocket.CreateDigitalIOAsync((SocketPinNumber)(i + 3), false);
		}
Esempio n. 15
0
 protected async override Task Initialize(ISocket parentSocket)
 {
     _outputPin = await parentSocket.CreateDigitalIOAsync((SocketPinNumber)5, false);
 }
Esempio n. 16
0
 protected async override Task Initialize(ISocket parentSocket)
 {
     this.enable = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Five, false);
 }
Esempio n. 17
0
		protected async override Task Initialize(ISocket parentSocket) {
			this.red = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Four, false);
			this.green = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Five, false);
			this.blue = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Three, false);
		}
Esempio n. 18
0
		protected async override Task Initialize(ISocket parentSocket) {
			this.input = await parentSocket.CreateAnalogIOAsync(SocketPinNumber.Three);
			this.enable = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Six, true);
		}
Esempio n. 19
0
 protected async override Task Initialize(ISocket parentSocket)
 {
     _outputPin = await parentSocket.CreateDigitalIOAsync((SocketPinNumber)5, false);
 }
Esempio n. 20
0
        protected async override Task Initialize(ISocket parentSocket)
        {
            this.input = await parentSocket.CreateAnalogIOAsync(SocketPinNumber.Three);

            this.enable = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Six, true);
        }