Beispiel #1
0
        public MainPage()
        {
            this.InitializeComponent();

            // Create a new SpeechSynthesizer instance for later use.
            synthesizer = new SpeechSynthesizer();

            // Initialize the ADC chip for use
            adcController = (await AdcController.GetControllersAsync(AdcMcp3008Provider.GetAdcProvider()))[0];
            LowPotAdcChannel = adcController.OpenChannel(LowPotentiometerADCChannel);
            HighPotAdcChannel = adcController.OpenChannel(HighPotentiometerADCChannel);
            CdsAdcChannel = adcController.OpenChannel(CDSADCChannel);
        }
        public async void Run(IBackgroundTaskInstance taskInstance)
        {
            deferral = taskInstance.GetDeferral();
            mode = AdcChannelMode.SingleEnded;
            //mode = AdcChannelMode.Differential;
            AdcController controller = (await AdcController.GetControllersAsync(AdcAds1x15.AdcAds1x15Provider.GetAdcProvider(AdcAds1x15.Ads1x15Type.Ads1115)))[0];
            controller.ChannelMode = mode;
            channelZero = controller.OpenChannel(0);
            channelOne = controller.OpenChannel(1);
            channelTwo = controller.OpenChannel(2);
            channelThree = controller.OpenChannel(3);
            timer = ThreadPoolTimer.CreatePeriodicTimer(this.Tick, TimeSpan.FromMilliseconds(1000));

        }
        public void Dispose()
        {
            if (updater != null)
            {
                updater.Dispose();
                updater = null;
            }

            if (adcChannel != null)
            {
                adcChannel.Dispose();
                adcChannel = null;
            }

            isInitialized = false;
        }
 public MCP9700A(AdcChannel channel, int referenceMilliVolts = 3300)
     : base(channel, referenceMilliVolts, 530, 11, -2)
 {
 }
 public MCP9700AE(AdcChannel channel, int referenceMilliVolts = 3300)
     : base(channel, referenceMilliVolts, 400, 19.5, -4)
 {
 }
Beispiel #6
0
 public void Dispose()
 {
     if (updater != null)
     {
         updater.Dispose();
         updater = null;
     }
     if (buttonPin != null)
     {
         buttonPin.Dispose();
         buttonPin = null;
     }
     if (xChannel != null)
     {
         xChannel.Dispose();
         xChannel = null;
     }
     if (yChannel != null)
     {
         yChannel.Dispose();
         yChannel = null;
     }
     isInitialized = false;
 }
 public static Ldr GetSensor(AdcChannel channel)
 {
     return new Ldr(channel);
 }
 public Ldr(AdcChannel channel)
 {
     this.channel = channel;
 }
 public MCP9701A(AdcChannel channel, int referenceMilliVolts = 3300)
     : base(channel, referenceMilliVolts, 400, 19.53, -6)
 {
 }