예제 #1
0
 private void MainPage_Unloaded(object sender, object args)
 {
     // Cleanup
     onepin.Dispose();
     twopin.Dispose();
     threepin.Dispose();
     fourpin.Dispose();
     fivepin.Dispose();
     sixpin.Dispose();
 }
예제 #2
0
 private void MainPage_Unloaded(object sender, RoutedEventArgs e)
 {
     RedLED.Dispose();
     GreenLED.Dispose();
     BlueLED.Dispose();
     YellowLED.Dispose();
     RGBRedLED.Dispose();
     RGBGreenLED.Dispose();
     RGBBlueLED.Dispose();
 }
예제 #3
0
        private void SetGPIOWrite(int in1, int in2, int in3, int in4)
        {
            if (in1 == 0 || in1 == -1)
            {
                IN1.Write(GpioPinValue.Low);
            }
            if (in1 == 1)
            {
                IN1.Write(GpioPinValue.High);
            }
            if (in1 == -1)
            {
                IN1.Dispose();
            }

            if (in2 == 0 || in2 == -1)
            {
                IN2.Write(GpioPinValue.Low);
            }
            if (in2 == 1)
            {
                IN2.Write(GpioPinValue.High);
            }
            if (in2 == -1)
            {
                IN2.Dispose();
            }

            if (in3 == 0 || in3 == -1)
            {
                IN3.Write(GpioPinValue.Low);
            }
            if (in3 == 1)
            {
                IN3.Write(GpioPinValue.High);
            }
            if (in3 == -1)
            {
                IN3.Dispose();
            }


            if (in4 == 0 || in4 == -1)
            {
                IN4.Write(GpioPinValue.Low);
            }
            if (in4 == 1)
            {
                IN4.Write(GpioPinValue.High);
            }
            if (in4 == -1)
            {
                IN4.Dispose();
            }
        }
예제 #4
0
 private void Stop()
 {
     TurnOffLED();
     blinkyTimer.Stop();
     if (pin != null)
     {
         pin.Dispose();
         pin = null;
     }
     BlinkyStartStop.Content = "START";
 }
예제 #5
0
        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            _timer.Stop();

            _pin.Dispose();
            _pin = null;

            _dht = null;

            base.OnNavigatedFrom(e);
        }
예제 #6
0
 public void Dispose()
 {
     if (chipSelectGpioPin != null)
     {
         chipSelectGpioPin.Dispose();
     }
     if (rfm9XLoraModem != null)
     {
         rfm9XLoraModem.Dispose();
     }
 }
예제 #7
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                gpioPin.Dispose();
            }

            gpioPin = null;
        }
예제 #8
0
 private void Close()
 {
     try
     {
         pin.Dispose();
     }
     catch (Exception ex)
     {
         //ioF.writeTOFileAs(ex.StackTrace);
     }
 }
예제 #9
0
 public void Dispose()
 {
     if (_stopwatch != null)
     {
         _stopwatch.Stop();
     }
     if (_dhtPin != null)
     {
         _dhtPin.Dispose();
     }
 }
 private void Stop()
 {
     TurnOffLED();
     blinkyTimer.Stop();
     if (pin != null)
     {
         pin.Dispose();
         pin = null;
     }
     BlinkyStartStop.Content = loader.GetString("BlinkyStart");
 }
예제 #11
0
        public Task Dispose()
        {
            var task = Task.Factory.StartNew(() =>
            {
                ButtonOne.Dispose();
                ButtonTwo.Dispose();
                ButtonThree.Dispose();
                controller = null;
            });

            return(task);
        }
예제 #12
0
        private void MainPage_Unloaded(object sender, RoutedEventArgs e)
        {
            if (spiAdc != null)
            {
                spiAdc.Dispose();
            }

            if (redLedPin != null)
            {
                redLedPin.Dispose();
            }
        }
예제 #13
0
        private void ClosePins()
        {
            oLowbeamPin.Dispose();
            oHighbeamPin.Dispose();

            oBrakePin.Dispose();

            oReversePin.Dispose();

            oTurnLeftPin.Dispose();
            oTurnRightPin.Dispose();
        }
예제 #14
0
        protected override void Dispose(bool disposing)
        {
            // Only managed resources to dispose
            if (!disposing)
            {
                return;
            }

            // Close device
            _resetPin?.Dispose();
            _networkController?.Dispose();
        }
예제 #15
0
        /// <summary>
        /// Cleans up the resources.
        /// </summary>
        public void Dispose()
        {
            d1.ValueChanged -= D1_ValueChanged;
            d2.ValueChanged -= D2_ValueChanged;
            d3.ValueChanged -= D3_ValueChanged;
            d4.ValueChanged -= D4_ValueChanged;

            d1.Dispose();
            d2.Dispose();
            d3.Dispose();
            d4.Dispose();
        }
예제 #16
0
        /// <summary>
        /// Disables the relays and then cleans up the resources.
        /// </summary>
        public void Dispose()
        {
            relay1.Write(GpioPinValue.Low);
            relay2.Write(GpioPinValue.Low);
            relay3.Write(GpioPinValue.Low);
            relay4.Write(GpioPinValue.Low);

            relay1.Dispose();
            relay2.Dispose();
            relay3.Dispose();
            relay4.Dispose();
        }
예제 #17
0
        public void Dispose()
        {
            Debug.WriteLine("Object destroyed via Dispose", DEBUG_CAT);

            IsEnabled         = false;
            IsEnabledChanged -= OnIsEnabledChanged;

            data0.Dispose();
            data1.Dispose();

            ClearValues();
        }
예제 #18
0
        /// <summary>
        /// Cleans up the resources.
        /// </summary>
        public void Dispose()
        {
            photocoupler1.ValueChanged -= Photocoupler1_ValueChanged;
            photocoupler2.ValueChanged -= Photocoupler2_ValueChanged;
            photocoupler3.ValueChanged -= Photocoupler3_ValueChanged;
            photocoupler4.ValueChanged -= Photocoupler4_ValueChanged;

            photocoupler1.Dispose();
            photocoupler2.Dispose();
            photocoupler3.Dispose();
            photocoupler4.Dispose();
        }
예제 #19
0
        /// <summary>
        /// Cleans up the resources.
        /// </summary>
        public void Dispose()
        {
            optocoupler1.ValueChanged -= Optocoupler1_ValueChanged;
            optocoupler2.ValueChanged -= Optocoupler2_ValueChanged;
            optocoupler3.ValueChanged -= Optocoupler3_ValueChanged;
            optocoupler4.ValueChanged -= Optocoupler4_ValueChanged;

            optocoupler1.Dispose();
            optocoupler2.Dispose();
            optocoupler3.Dispose();
            optocoupler4.Dispose();
        }
예제 #20
0
 /// <inheritdoc/>
 public void Dispose()
 {
     if (buttonHelper != null)
     {
         buttonHelper.Dispose();
         buttonHelper = null;
     }
     if (clockPin != null)
     {
         clockPin.Dispose();
         clockPin = null;
     }
 }
예제 #21
0
파일: Class1.cs 프로젝트: simple0812/IoT
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                InterruptPin.Dispose();
                if (_mpu6050Device != null)
                {
                    _mpu6050Device.Dispose();
                    _mpu6050Device = null;
                }
                disposedValue = true;
            }
        }
예제 #22
0
파일: Ds1339.cs 프로젝트: yang123vc/Zen.Iot
 private void Dispose(bool disposing)
 {
     if (!_isDisposed)
     {
         if (disposing)
         {
             _device?.Dispose();
             _interruptPin.ValueChanged -= OnRaiseInterrupts;
             _interruptPin.Dispose();
         }
         _isDisposed = true;
     }
 }
예제 #23
0
 protected virtual void Dispose(bool disposing)
 {
     if (!disposed)
     {
         interruptPin.Dispose();
         if (mpu6050 != null)
         {
             mpu6050.Dispose();
             mpu6050 = null;
         }
         disposed = true;
     }
 }
        public void Dispose()
        {
            _receiverEnabledPin.Dispose();
            _transmitterEnabledPin.Dispose();
            _terminationResistorPin.Dispose();
            _portPowerPin.Dispose();

            if (Port.IsOpen)
            {
                Port.Close();
            }
            Port.Dispose();
        }
예제 #25
0
 public static void Close()
 {
     try
     {
         pin.Write(GpioPinValue.Low);
         pin.Dispose();
         isOn = false;
     }
     catch (Exception ex)
     {
         //ioF.writeTOFileAs(ex.StackTrace);
     }
 }
예제 #26
0
        /// <summary>
        /// Cleans up the resources.
        /// </summary>
        public void Dispose()
        {
            d1.ValueChanged -= D1_ValueChanged;
            d2.ValueChanged -= D2_ValueChanged;
            d3.ValueChanged -= D3_ValueChanged;
            d4.ValueChanged -= D4_ValueChanged;
            capacitiveTouchInt.ValueChanged -= CapacitiveTouch_ValueChanged;

            d1.Dispose();
            d2.Dispose();
            d3.Dispose();
            d4.Dispose();
            capacitiveTouchInt.Dispose();
        }
예제 #27
0
        /// <summary>
        /// Röleleri pasifleştirir ve pinleri serbest bırakır.
        /// </summary>
        public void Dispose()
        {
            // Röleleri pasifleştir.
            relay1.Write(GpioPinValue.Low);
            relay2.Write(GpioPinValue.Low);
            relay3.Write(GpioPinValue.Low);
            relay4.Write(GpioPinValue.Low);

            // Pinleri serbest bırak.
            relay1.Dispose();
            relay2.Dispose();
            relay3.Dispose();
            relay4.Dispose();
        }
예제 #28
0
        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            base.OnNavigatedFrom(e);

            timer.Stop();

            sensorPin?.Dispose();
            sensorPin = null;

            ledPin?.Dispose();
            ledPin = null;

            dht = null;
        }
예제 #29
0
        // Release resources, stop recognizer, release pins, etc...
        private async void MainPage_Unloaded(object sender, object args)
        {
            // Stop recognizing
            await recognizer.ContinuousRecognitionSession.StopAsync();

            // Release pins
            redPin.Dispose();
            greenPin.Dispose();
            recognizer.Dispose();

            gpio       = null;
            redPin     = null;
            greenPin   = null;
            recognizer = null;
        }
 void StopScenario()
 {
     // Release the GPIO pin.
     if (led1 != null && led2 != null && button1 != null && button2 != null)
     {
         led1.Dispose();
         led2.Dispose();
         button1.Dispose();
         button2.Dispose();
         led1    = null;
         led2    = null;
         button1 = null;
         button2 = null;
     }
 }