Пример #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("\nUSB HID Remote I/O Analog Input Test\n");

            IO.Interfaces.Message64.Messenger m =
                new IO.Objects.libsimpleio.HID.Messenger();

            IO.Remote.Device dev = new IO.Remote.Device(m);

            Console.Write("Channels:    ");

            foreach (int input in dev.ADC_Available())
            {
                Console.Write(" " + input.ToString());
            }

            Console.WriteLine();

            ArrayList S = new ArrayList();

            foreach (int c in dev.ADC_Available())
            {
                S.Add(new IO.Remote.ADC(dev, c));
            }

            Console.Write("Resolutions: ");

            foreach (IO.Interfaces.ADC.Sample inp in S)
            {
                Console.Write(" " + inp.resolution.ToString());
            }

            Console.WriteLine();

            for (;;)
            {
                Console.Write("Samples:     ");

                foreach (IO.Interfaces.ADC.Sample inp in S)
                {
                    Console.Write(String.Format(" {0:00000}", inp.sample));
                }

                Console.WriteLine();
                Thread.Sleep(2000);
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("\nRemote I/O Analog Input Test\n");

            IO.Remote.Device remdev = new IO.Remote.Device();

            Console.Write("Channels:    ");

            foreach (int input in remdev.ADC_Available())
            {
                Console.Write(" " + input.ToString());
            }

            Console.WriteLine();

            ArrayList S = new ArrayList();

            foreach (int c in remdev.ADC_Available())
            {
                S.Add(new IO.Remote.ADC(remdev, c));
            }

            Console.Write("Resolutions: ");

            foreach (IO.Interfaces.ADC.Sample inp in S)
            {
                Console.Write(" " + inp.resolution.ToString());
            }

            Console.WriteLine();

            for (;;)
            {
                Console.Write("Samples:     ");

                foreach (IO.Interfaces.ADC.Sample inp in S)
                {
                    Console.Write(String.Format(" {0:00000}", inp.sample));
                }

                Console.WriteLine();
                System.Threading.Thread.Sleep(2000);
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("\nUSB HID Remote I/O Device Information Query Test\n");

            IO.Objects.USB.HID.Messenger m   = new IO.Objects.USB.HID.Messenger();
            IO.Remote.Device             dev = new IO.Remote.Device(m);

            // Display some device information

            Console.WriteLine(m.Info);
            Console.WriteLine(dev.Version);
            Console.WriteLine(dev.Capabilities);
            Console.WriteLine();

            // Display the available ADC inputs

            Console.Write("ADC inputs:  ");

            foreach (int input in dev.ADC_Available())
            {
                Console.Write(input.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available DAC outputs

            Console.Write("DAC outputs: ");

            foreach (int input in dev.DAC_Available())
            {
                Console.Write(input.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available GPIO pins

            Console.Write("GPIO Pins:   ");

            foreach (int pin in dev.GPIO_Available())
            {
                Console.Write(pin.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available I2C buses

            Console.Write("I2C buses:   ");

            foreach (int bus in dev.I2C_Available())
            {
                Console.Write(bus.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available PWM outputs

            Console.Write("PWM outputs: ");

            foreach (int bus in dev.PWM_Available())
            {
                Console.Write(bus.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available SPI devices

            Console.Write("SPI devices: ");

            foreach (int bus in dev.SPI_Available())
            {
                Console.Write(bus.ToString() + " ");
            }

            Console.WriteLine();
        }
Пример #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("\nUDP Remote I/O Device Information Query Test\n");

            if (args.Length != 1)
            {
                Console.WriteLine("Usage: test_query_udp <hostname>");
                Environment.Exit(1);
            }

            IO.Interfaces.Message64.Messenger m =
                new IO.Objects.Message64.UDP.Messenger(args[0], 8087);

            var remdev = new IO.Remote.Device(m);

            Console.WriteLine(remdev.Version);
            Console.WriteLine(remdev.Capabilities);
            Console.WriteLine();

            // Display the available ADC inputs

            Console.Write("ADC inputs:  ");

            foreach (int input in remdev.ADC_Available())
            {
                Console.Write(input.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available DAC outputs

            Console.Write("DAC outputs: ");

            foreach (int output in remdev.DAC_Available())
            {
                Console.Write(output.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available GPIO pins

            Console.Write("GPIO Pins:   ");

            foreach (int pin in remdev.GPIO_Available())
            {
                Console.Write(pin.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available I2C buses

            Console.Write("I2C buses:   ");

            foreach (int bus in remdev.I2C_Available())
            {
                Console.Write(bus.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available PWM outputs

            Console.Write("PWM outputs: ");

            foreach (int bus in remdev.PWM_Available())
            {
                Console.Write(bus.ToString() + " ");
            }

            Console.WriteLine();

            // Display the available SPI devices

            Console.Write("SPI devices: ");

            foreach (int bus in remdev.SPI_Available())
            {
                Console.Write(bus.ToString() + " ");
            }

            Console.WriteLine();
        }