Example #1
0
        public async void moveDown()
        {
            //Hold all current operations to prevent damage on shutter engine
            Shared.Communication.TCP_Connect tcpcon = new Communication.TCP_Connect(new Windows.Networking.HostName("minwinpc"));
            await tcpcon.Connect();

            stop(tcpcon);

            //Start the engine
            string PinRequest = String.Format("4${0}${1}${2}${3}",
                                              this.I2C_Slave_Address,
                                              Shared.Communication.I2C_Helper.Mode.Mode2,
                                              (byte)this.Pin,
                                              1);
            await tcpcon.Send(PinRequest);

            string SecPinRequest = String.Format("4${0}${1}${2}${3}",
                                                 this.I2C_Slave_Address,
                                                 Shared.Communication.I2C_Helper.Mode.Mode2,
                                                 (byte)this.SecondaryPin,
                                                 1);
            await tcpcon.Send(SecPinRequest);

            tcpcon.Disconnect();
        }
Example #2
0
        public async void stop()
        {
            //Hold all current operations to prevent damage on shutter engine
            Shared.Communication.TCP_Connect tcpcon = new Communication.TCP_Connect(new Windows.Networking.HostName("minwinpc"));
            await tcpcon.Connect();

            stop(tcpcon);
            tcpcon.Disconnect();
        }
Example #3
0
        /// <summary>
        /// Turns off device
        /// </summary>
        /// <returns>Returns the status of device after operation</returns>
        public async Task <StatusEnum> TurnOff()
        {
            //var Response = await Communication.I2C_Helper.WriteRead(I2C_Slave_Address, Communication.I2C_Helper.Mode.Mode2, (byte)Pin, 0);
            Shared.Communication.TCP_Connect tcpcon = new Communication.TCP_Connect(new Windows.Networking.HostName("minwinpc"));
            await tcpcon.Connect();

            string PinRequest = String.Format("4${0}${1}${2}${3}",
                                              this.I2C_Slave_Address,
                                              Shared.Communication.I2C_Helper.Mode.Mode2,
                                              (byte)this.Pin,
                                              0);
            await tcpcon.Send(PinRequest);

            Status = StatusEnum.Off;
            tcpcon.Disconnect();

            return(Status);
        }