Exemplo n.º 1
0
 public static void InitializePeripherals()
 {
     LedGreen.Write(true);
     Clock        = new DS1307();
     ThermoCouple = new Max6675();
     InitializeStorage(true);
     InitializeClock(new DateTime(2012, 06, 06, 16, 22, 00));
     ThermoCouple.Initialize(ThermoCoupleChipSelect);
     TemperatureSampler = new Timer(new TimerCallback(LogTemperature), null, 250, TemperatureLoggerPeriod);
     LedGreen.Write(false);
 }
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);
            }
        }