Beispiel #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);
        }
Beispiel #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);
            }
        }
 private void _setSensorData(byte pin, byte[] data)
 {
     ArduinoAPICommand cmd = new ArduinoAPICommand(0x2, data);
     byte[] msg = cmd.GenerateCommand();
     _serialCommPort.Write(msg, 0, msg.Length);
 }
        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);
        }