当前位置: 首页>>代码示例>>C#>>正文


C# ISocket.CreateDigitalIOAsync方法代码示例

本文整理汇总了C#中ISocket.CreateDigitalIOAsync方法的典型用法代码示例。如果您正苦于以下问题:C# ISocket.CreateDigitalIOAsync方法的具体用法?C# ISocket.CreateDigitalIOAsync怎么用?C# ISocket.CreateDigitalIOAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISocket的用法示例。


在下文中一共展示了ISocket.CreateDigitalIOAsync方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialize

		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);
		}
开发者ID:amykatenicho,项目名称:IoTWorkshop,代码行数:8,代码来源:MaxO.cs

示例2: Initialize

        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);
                }
            };
		}
开发者ID:amykatenicho,项目名称:IoTWorkshop,代码行数:13,代码来源:Button.cs

示例3: Initialize

		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();
		}
开发者ID:amykatenicho,项目名称:IoTWorkshop,代码行数:13,代码来源:MotorDriverL298.cs

示例4: Initialize

		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();
		}
开发者ID:amykatenicho,项目名称:IoTWorkshop,代码行数:18,代码来源:CharacterDisplay.cs

示例5: Initialize

		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);
		}
开发者ID:amykatenicho,项目名称:IoTWorkshop,代码行数:5,代码来源:Joystick.cs

示例6: Initialize

		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);
		}
开发者ID:amykatenicho,项目名称:IoTWorkshop,代码行数:6,代码来源:LEDStrip.cs

示例7: Initialize

 protected async override Task Initialize(ISocket parentSocket)
 {
     _outputPin = await parentSocket.CreateDigitalIOAsync((SocketPinNumber)5, false);
 }
开发者ID:martincalsyn,项目名称:CortanaAllJoynDemo,代码行数:4,代码来源:RelayX1.cs

示例8: Initialize

		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);
		}
开发者ID:amykatenicho,项目名称:IoTWorkshop,代码行数:5,代码来源:LED7C.cs

示例9: Initialize

		protected async override Task Initialize(ISocket parentSocket) {
			this.input = await parentSocket.CreateAnalogIOAsync(SocketPinNumber.Three);
			this.enable = await parentSocket.CreateDigitalIOAsync(SocketPinNumber.Six, true);
		}
开发者ID:amykatenicho,项目名称:IoTWorkshop,代码行数:4,代码来源:Moisture.cs


注:本文中的ISocket.CreateDigitalIOAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。