GR-PEACH�N���X
예제 #1
0
        public static void Main()
        {
            var peach = new Peach();

            var ipAddress = NetworkUtility.InitNetwork();
            if (ipAddress == "0.0.0.0")
            {
                Debug.Print("InitNetwork Failed");
                return;
            }

            using (var request = WebRequest.Create(new Uri("http://www.microsoft.com/ja-jp")) as HttpWebRequest)
            {
                request.Method = "GET";

                using (var response = request.GetResponse() as HttpWebResponse)
                {
                    if (response.StatusCode == HttpStatusCode.OK)
                    {
                        var resContentBytes = new byte[(int)response.ContentLength];
                        using (var ress = response.GetResponseStream())
                        {
                            ress.Read(resContentBytes, 0, (int)response.ContentLength);
                            var resContentChars = Encoding.UTF8.GetChars(resContentBytes);
                            var resContent = new string(resContentChars);
                            Debug.Print(resContent);
                        }

                        peach.PulseDebugLed(100, 5);
                    }
                }
            }

            Thread.Sleep(3000);
        }
예제 #2
0
        public Program()
        {
            _peach = new Peach();

            _peach.Button.ButtonPressed += Button_ButtonPressed;
            _peach.Button.ButtonReleased += Button_ButtonReleased;
        }
예제 #3
0
        public static void Main()
        {
            _peach = new Peach();
            _peach.Button.ButtonPressed += Button_ButtonPressed;

            Debug.Print("Test Started");

            while (true) { }
        }
예제 #4
0
        private void Run()
        {
            _peach = new Peach();
            _peach.Button.ButtonPressed += Button_ButtonPressed;

            _sensor = new AnalogSensor(Cpu.AnalogChannel.ANALOG_0);
            _sensor.MeasurementComplete += _sensor_MeasurementComplete;
            _sensor.Interval = 1000;

            _testTimer = new Timer(PollingMeasure, null, new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 1));

            while (true) { }
        }
예제 #5
0
        private void Run()
        {
            _peach = new Peach();
            _peach.Button.ButtonPressed += Button_ButtonPressed;

            _sensor = (new SensorBoard()).Terminal;
            _sensor.MeasurementComplete += _sensor_MeasurementComplete;
            _sensor.Interval = 1000;

            _testTimer = new Timer(PollingMeasure, null, new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 1));

            while (true) { }
        }
예제 #6
0
        private void Run()
        {
            _peach = new Peach();
            _peach.Button.ButtonPressed += Button_ButtonPressed;

            _accelerometer = (new SensorBoard()).Accelerometer;
            _accelerometer.MeasurementRange = Accelerometer.Range.FourG;
            _accelerometer.MeasurementComplete += _accelerometer_MeasurementComplete;
            _accelerometer.Interval = 1000;

            _testTimer = new Timer(PollingMeasure, null, new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 1));

            while (true) { }
        }
예제 #7
0
        private void Run()
        {
            var accel = new Adxl345 { MeasurementRange = Adxl345.Range.FourG };

            _peach = new Peach();
            _peach.Button.ButtonPressed += Button_ButtonPressed; ;

            _accelerometer = new Adxl345 { MeasurementRange = Adxl345.Range.FourG };
            _accelerometer.MeasurementComplete += _accelerometer_MeasurementComplete;
            _accelerometer.Interval = 1000;

            _testTimer = new Timer(PollingMeasure, null, new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 1));

            while (true) { }
        }
예제 #8
0
        public static void Main()
        {
            _peach = new Peach();

            while (true)
            {
                if (_peach.Button.IsPressed)
                {
                    _peach.SetDebugLed(true);
                    Debug.Print("Button Pressed");
                }
                else
                {
                    _peach.SetDebugLed(false);
                    Debug.Print("Button Released");
                }

                Thread.Sleep(200);
            }
        }