Beispiel #1
0
        public static void Main()
        {
            string devices = DacController.GetDeviceSelector();

            Console.WriteLine("DAC controllers: " + devices);

            // get default controller
            DacController dac = DacController.GetDefault();

            // open channel 0
            DacChannel dacChannel = dac.OpenChannel(0);

            // get DAC resolution
            dacResolution = dac.ResolutionInBits;

            // uncomment the scenario to test
            /////////////////////////////////////////
            // !!note that none of these returns!! //
            /////////////////////////////////////////

            Scenario2TriangleWave.Execute(ref dacChannel);

            //Scenario3SquareWave.Execute(ref dacChannel);

            //Scenario4SineWave.Execute(ref dacChannel);


            Thread.Sleep(Timeout.Infinite);
        }
Beispiel #2
0
        /// <summary>Creates an analog output on the given pin.</summary>
        /// <param name="AnalogPin">The pin to create the interface on.</param>
        /// <returns>The new interface.</returns>
        public DacChannel CreateAnalogOutput(int AnalogPin)
        {
            var AnalogController = DacController.GetDefault();
            var ThisAnalogPin    = AnalogController.OpenChannel(AnalogPin);

            return(ThisAnalogPin);
        }