Example #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("\nRemote I/O Grove Temperature Sensor (thermistor) Test\n");

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

            IO.Interfaces.ADC.Sample S = new IO.Remote.ADC(remdev, 0);

            IO.Interfaces.ADC.Input V = new IO.Interfaces.ADC.Input(S, 3.3);

            IO.Devices.Grove.Temperature.Device T =
                new IO.Devices.Grove.Temperature.Device(V);

            for (;;)
            {
                Console.WriteLine("Temperature => " + T.Celsius.ToString("F2"));
                System.Threading.Thread.Sleep(1000);
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("\nRemote I/O Grove Temperature Sensor (thermistor) Test\n");

            // Get ADC hardware parameters

            IO.Objects.libsimpleio.Device.Designator desg;

            Console.Write("ADC chip:       ");
            desg.chip = uint.Parse(Console.ReadLine());

            Console.Write("ADC channel:    ");
            desg.chan = uint.Parse(Console.ReadLine());

            Console.Write("ADC resolution: ");
            int resolution = int.Parse(Console.ReadLine());

            Console.Write("ADC reference:  ");
            double reference = double.Parse(Console.ReadLine());

            Console.WriteLine();

            // Create objects

            IO.Interfaces.ADC.Sample S =
                new IO.Objects.libsimpleio.ADC.Sample(desg, resolution);

            IO.Interfaces.ADC.Input V = new IO.Interfaces.ADC.Input(S, reference);

            IO.Devices.Grove.Temperature.Device T =
                new IO.Devices.Grove.Temperature.Device(V);

            for (;;)
            {
                Console.WriteLine("Temperature => " + T.Celsius.ToString("F2"));
                System.Threading.Thread.Sleep(1000);
            }
        }