예제 #1
0
        private void _setSensorData(byte pin, byte[] data)
        {
            ArduinoAPICommand cmd = new ArduinoAPICommand(0x2, data);

            byte[] msg = cmd.GenerateCommand();
            _serialCommPort.Write(msg, 0, msg.Length);
        }
예제 #2
0
        private void _getSensorData(byte pin, GetSensorDataEventHandler callback)
        {
            byte[]            data = new byte[16];
            ArduinoAPICommand cmd  = new ArduinoAPICommand(0x1, data);

            byte[] msg = cmd.GenerateCommand();
            _serialCommPort.Write(msg, 0, msg.Length);
            _sensorDataArrivedSignal.WaitOne();

            if (_isExit == false)
            {
                callback(_sensorData);
            }
        }
예제 #3
0
 private void _setSensorData(byte pin, byte[] data)
 {
     ArduinoAPICommand cmd = new ArduinoAPICommand(0x2, data);
     byte[] msg = cmd.GenerateCommand();
     _serialCommPort.Write(msg, 0, msg.Length);
 }
예제 #4
0
        private void _getSensorData(byte pin, GetSensorDataEventHandler callback)
        {
            byte[] data = new byte[16];
            ArduinoAPICommand cmd = new ArduinoAPICommand(0x1, data);
            byte[] msg = cmd.GenerateCommand();
            _serialCommPort.Write(msg, 0, msg.Length);
            _sensorDataArrivedSignal.WaitOne();

            if (_isExit == false)
                callback(_sensorData);
        }