Ejemplo n.º 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public Controller()
        {
            this.errorLogger = new LedErrorLogger(LED_ERROR_PIN);

#if !EMULATOR
            // check for SD presence
            this.CheckSD();
#endif

            // create sensors instances
            this.dataLogger = new SDDataLogger(SD_DATA_LOGGING);
            this.anemometer = new Anemometer(ANEMOMETER_PIN);
            this.sht1x      = new SHT1X(SHT1X_DATA_PIN, SHT1X_CLK_PIN, SHT1X.Voltage.Vdd_3_5V);
            this.ldr        = new Ldr(LDR_ANALOG_CHANNEL, LDR_ADC_RESOLUTION, LDR_LOAD_RESISTOR);

            // RTC
            this.rtc = Rtc.Instance;

            // configure and create Web Server
            MicroWebServerConfig uWebServerConfig =
                new MicroWebServerConfig {
                Backlog         = WS_BACKLOG,
                HttpPort        = WS_HTTP_PORT,
                MaxWorkerThread = WS_MAX_WORKER_THREAD,
                WebRoot         = SD_WEBROOT
            };

            this.uWebServer = new MicroWebServer(uWebServerConfig);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public Controller()
        {
            this.errorLogger = new LedErrorLogger(LED_ERROR_PIN);

            #if !EMULATOR
            // check for SD presence
            this.CheckSD();
            #endif

            // create sensors instances
            this.dataLogger = new SDDataLogger(SD_DATA_LOGGING);
            this.anemometer = new Anemometer(ANEMOMETER_PIN);
            this.sht1x = new SHT1X(SHT1X_DATA_PIN, SHT1X_CLK_PIN, SHT1X.Voltage.Vdd_3_5V);
            this.ldr = new Ldr(LDR_ANALOG_CHANNEL, LDR_ADC_RESOLUTION, LDR_LOAD_RESISTOR);

            // RTC
            this.rtc = Rtc.Instance;

            // configure and create Web Server
            MicroWebServerConfig uWebServerConfig =
                new MicroWebServerConfig {
                    Backlog = WS_BACKLOG,
                    HttpPort = WS_HTTP_PORT,
                    MaxWorkerThread = WS_MAX_WORKER_THREAD,
                    WebRoot = SD_WEBROOT
                };

            this.uWebServer = new MicroWebServer(uWebServerConfig);
        }