Microsoft.SPOT.Hardware.OutputPort.Write C# (CSharp) Method

Write() public method

public Write ( bool state ) : void
state bool
return void
        public void Write(bool state)
        {
            Console.WriteLine("Write({0})", this.Id);
            GPIOManager.Instance.Write(this.Id, state);
        }

Usage Example

Exemplo n.º 1
0
        public static void Main()
        {
            OutputPort o = new OutputPort(Pins.ONBOARD_LED, true);

            while (true)
            {
                Thread.Sleep(1000);
                o.Write(true);
                Thread.Sleep(1000);
                o.Write(false);
            }
            // write your code here

            //    I2CDevice i2c = new I2CDevice(new I2CDevice.Configuration(0x38,100));
            //    Microsoft.SPOT.Hardware.I2CDevice.I2CTransaction[] actions;
            //    var buffer = new byte[1];

            //    actions = new I2CDevice.I2CTransaction[]
            //    {
            //        I2CDevice.CreateWriteTransaction(buffer)
            //    };

            //    while (true)
            //    {
            //        buffer[0] = 255;
            //        i2c.Execute(actions, 1000);
            //        Thread.Sleep(1000);

            //        buffer[0] = 0;
            //        i2c.Execute(actions, 1000);
            //        Thread.Sleep(1000);
            //    }
        }
All Usage Examples Of Microsoft.SPOT.Hardware.OutputPort::Write