コード例 #1
0
        public bool IsChannelModeSupported(AdcChannelMode channelMode)
        {
            switch (channelMode)
            {
            case AdcChannelMode.Differential:
            case AdcChannelMode.SingleEnded:
                break;

            default:
                throw new ArgumentException();
            }

            return(m_provider.IsChannelModeSupported((ProviderAdcChannelMode)channelMode));
        }
コード例 #2
0
        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));

        }
コード例 #3
0
        public bool IsChannelModeSupported(AdcChannelMode channelMode)
        {
            switch (channelMode)
            {
            case AdcChannelMode.Differential:
            case AdcChannelMode.SingleEnded:
                break;

            default:
                throw new ArgumentException();
            }

            return m_provider.IsChannelModeSupported((ProviderAdcChannelMode)channelMode);
        }
コード例 #4
0
 /// <summary>
 /// Verifies that the specified channel mode is supported by the controller.
 /// </summary>
 /// <param name="channelMode">
 /// The channel mode.
 /// </param>
 /// <returns>
 /// True if the specified channel mode is supported, otherwise false.
 /// </returns>
 public bool IsChannelModeSupported(AdcChannelMode channelMode)
 {
     return(NativeIsChannelModeSupported((int)channelMode));
 }
コード例 #5
0
ファイル: Adc.cs プロジェクト: Gravicode/GlideTinyCLR2
 public extern void SetChannelMode(AdcChannelMode value);
コード例 #6
0
ファイル: Adc.cs プロジェクト: Gravicode/GlideTinyCLR2
 public extern bool IsChannelModeSupported(AdcChannelMode mode);