コード例 #1
0
ファイル: Program.cs プロジェクト: cjdaly/napkin
        public static void Main()
        {
            Debug.Print("Hello!   mem: " + Debug.GC(false));

            _cerbee2 = new ThreadedSerialDevice();
            _cerbee2.ReadLine += new ThreadedSerialDevice.ReadHandler(_cerbee2_ReadLine);

            _midiDriver = new MidiDriver(Pins.GPIO_PIN_D4);
            _midiDriver.Reset();

            _uLcd144 = new ULcd144Device(Pins.GPIO_PIN_D9, Serial.COM3);
            _uLcd144.Reset();
            _uLcd144.Clear();
            _uLcd144.WriteMessage("Hello", 0, 0);
            _uLcd144.WriteMessage("World!", 0, 1);

            _deadOnRtc = new DeadOnRTCDriver(Pins.GPIO_PIN_D10, SPI_Devices.SPI1);

            for (int i = 0; i < 4; i++)
            {
                DeadOnRTCData rtcData = _deadOnRtc.ReadData();
                DateTime dt = rtcData.GetDateTime();
                Debug.Print("DateTime: " + dt.ToString());
                _uLcd144.ConsoleWriteLine(dt.ToString());
                Thread.Sleep(5000);
            }

            Debug.Print("Goodbye!   mem: " + Debug.GC(false));
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: cjdaly/napkin
        void ProgramStarted()
        {
            Thread.Sleep(1000);

            Debug.Print("Hello from: " + DeviceId);

            _pcduino1 = new ThreadedSerialDevice(Serial.COM3);
            _pcduino1.ReadLine += new ThreadedSerialDevice.ReadHandler(_pcduino1_ReadLine);

            temperatureHumidity.MeasurementComplete += new TemperatureHumidity.MeasurementCompleteEventHandler(temperatureHumidity_MeasurementComplete);

            barometer.StopContinuousMeasurements();
            barometer.MeasurementComplete += new Barometer.MeasurementCompleteEventHandler(barometer_MeasurementComplete);

            gasSense.SetHeatingElement(true);

            Thread.Sleep(1000);

            _cycleThread = new Thread(CycleDriver);
            _cycleThread.Start();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: Gsaico/napkin
        void ProgramStarted()
        {
            led7c.SetColor(LED7C.LEDColor.Yellow);
            Thread.Sleep(500);

            Debug.Print("Hello from: " + DeviceId);

            temperatureHumidity.MeasurementComplete += new TemperatureHumidity.MeasurementCompleteEventHandler(temperatureHumidity_MeasurementComplete);

            barometer.StopContinuousMeasurements();
            barometer.MeasurementComplete += new Barometer.MeasurementCompleteEventHandler(barometer_MeasurementComplete);

            _bone3 = new ThreadedSerialDevice(Serial.COM3);
            _bone3.ReadLine += new ThreadedSerialDevice.ReadHandler(_bone3_ReadLine);

            Thread.Sleep(500);
            char_Display.SetBacklight(true);
            char_Display.Clear();
            char_Display.CursorHome();
            char_Display.PrintString("Hello World!");
            Thread.Sleep(500);

            led7c.SetColor(LED7C.LEDColor.Green);
            Thread.Sleep(500);

            _cycleThread = new Thread(CycleDriver);
            _cycleThread.Start();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: cjdaly/napkin
        void ProgramStarted()
        {
            led7c.SetColor(LED7C.LEDColor.Yellow);
            Thread.Sleep(1000);

            Debug.Print("Hello from: " + DeviceId);

            _rock1 = new ThreadedSerialDevice(Serial.COM3);
            _rock1.ReadLine += new ThreadedSerialDevice.ReadHandler(_rock1_ReadLine);

            temperatureHumidity.MeasurementComplete += new TemperatureHumidity.MeasurementCompleteEventHandler(temperatureHumidity_MeasurementComplete);

            barometer.StopContinuousMeasurements();
            barometer.MeasurementComplete += new Barometer.MeasurementCompleteEventHandler(barometer_MeasurementComplete);

            button.ButtonPressed += new Button.ButtonEventHandler(button_ButtonPressed);
            button.ButtonReleased += new Button.ButtonEventHandler(button_ButtonReleased);

            led7c.SetColor(LED7C.LEDColor.Green);
            Thread.Sleep(1000);

            _cycleThread = new Thread(CycleDriver);
            _cycleThread.Start();
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: cjdaly/napkin
        void ProgramStarted()
        {
            Debug.Print("Program Started");

            rfid.CardIDReceived += new RFID.CardIDReceivedEventHandler(rfid_CardIDReceived);

            _nd2_1 = new ThreadedSerialDevice(Serial.COM3);
            _nd2_1.ReadLine += new ThreadedSerialDevice.ReadHandler(_nd2_1_ReadLine);

            Debug.Print("mem: " + Debug.GC(false));
            _wiflyThread = new Thread(WiFlyDriver);
            _wiflyThread.Start();
            Debug.Print("mem: " + Debug.GC(false));
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: cjdaly/napkin
        void ProgramStarted()
        {
            Debug.Print("Hello from: " + DeviceId);

            _bone2 = new ThreadedSerialDevice(Serial.COM3);
            _bone2.ReadLine += new ThreadedSerialDevice.ReadHandler(_bone2_ReadLine);

            temperatureHumidity.MeasurementComplete += new TemperatureHumidity.MeasurementCompleteEventHandler(temperatureHumidity_MeasurementComplete);

            _cycleThread = new Thread(CycleDriver);
            _cycleThread.Start();
        }