Exemplo n.º 1
0
        public PIR_Module(Extender extender, DomoteerWebServer server)
        {
            this.server          = server;
            this.extender        = extender;
            interrupt            = extender.CreateInterruptInput(GT.Socket.Pin.Three, GT.SocketInterfaces.GlitchFilterMode.Off, GT.SocketInterfaces.ResistorMode.PullUp, GT.SocketInterfaces.InterruptMode.FallingEdge);
            interrupt.Interrupt += new GT.SocketInterfaces.InterruptEventHandler(mov_det);

            timer_cross       = new GT.Timer(20000);
            timer_cross.Tick += new GT.Timer.TickEventHandler(Timer_Cross_Tick);
        }
Exemplo n.º 2
0
        void ProgramStarted()
        {
            first     = true;
            time_sett = Resources.GetString(Resources.StringResources.PIR_Sensor);

            #region SENSORE TEMPERATURA
            s = new Sensore_Temperatura_43();
            s.setup();
            Temperatura t     = s.getTemp();
            double      valor = t.BinToCelsius();
            #endregion

            #region SERVER
            server = new DomoteerWebServer(ethernetJ11D, multicolorLED, displayT35, s);
            server.initConnection();
            server.RunWebServer();


            #endregion

            #region PIR

            pir = new PIR_Module(extender, server);

            #endregion

            #region SENSORE GAS
            sens = new Gas_Sensor(extender);
            #endregion

            #region TIMER_GAS
            timer_gas       = new GT.Timer(20000);
            timer_gas.Tick += new GT.Timer.TickEventHandler(Timer_Gas_Tick);
            timer_gas.Start();

            #endregion

            #region TIMER_AGGIORNAMENTO_SCHERMO
            timer_display       = new GT.Timer(5000);
            timer_display.Tick += new GT.Timer.TickEventHandler(Timer_Display_Tick);
            timer_display.Start();
            #endregion

            button.ButtonPressed += new GTM.GHIElectronics.Button.ButtonEventHandler(GetTemperatures);

            setupWindow();
        }