using System;
using Tinkerforge;

namespace ExampleCSharp
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var ipcon = new IPConnection(); // Create IP connection
            var io = new BrickletIO4("h2R", ipcon); // Create device object
            ipcon.Connect("localhost", 4223); // Connect to brickd

            //Old Style
            io.GetMonoflop(0, out byte value, out long time, out long timeRemaining);
            Console.WriteLine("Remaining time: " + timeRemaining);

            //New Style            
            Console.WriteLine("Remaining time: " + io.GetMonoflop(0).TimeRemaining);
            
            ipcon.Disconnect();
            Console.WriteLine("Press enter to exit...");
            Console.ReadKey();

        }
    }
}
