Exemplo n.º 1
0
        public static void Main()
        {
            var relay = new Relay();

            relay.Initialize(GoSockets.Socket1);
            while (true)
            {
                relay.Activate(true);
                Thread.Sleep(1000);
                relay.Activate(false);
                Thread.Sleep(1000);
            }
        }
Exemplo n.º 2
0
        public static void Main()
        {
            var thermocouple = new Max6675();
            var relay        = new Relay();

            relay.Initialize(GoSockets.Socket8);
            thermocouple.Initialize(GoSockets.Socket7);
            while (true)
            {
                thermocouple.Read();
                if (thermocouple.Celsius < 21)
                {
                    relay.Activate(true);
                }
                else
                {
                    relay.Activate(false);
                }
                Debug.Print("Temp C:" + Shorten(thermocouple.Celsius.ToString()) + " / F:" + Shorten(thermocouple.Farenheit.ToString()));
                Thread.Sleep(1000);
            }
        }
Exemplo n.º 3
0
 public void ReadTemp()
 {
     ThermoCouple.Read();
     if (ThermoCouple.Celsius >= 28)
     {
         RelayStatus = true;
     }
     else
     {
         RelayStatus = false;
     }
     Relay.Activate(RelayStatus);
 }