Sha256: de5f349970146ac05a99e889e5fff501e54a5e8a92fc5013e76b8112ee4ea52c

Contents?: true

Size: 616 Bytes

Versions: 4

Compression:

Stored size: 616 Bytes

Contents

## use samples/sysex/SysexLedBlinkFirmata/SysexLedBlinkFirmata.ino

require File.expand_path 'test_helper', File.dirname(__FILE__)

class TestSysex < MiniTest::Unit::TestCase

  def setup
    @arduino = ArduinoFirmata.connect ENV['ARDUINO']
  end

  def teardown
    @arduino.close
  end

  def test_sysex_command
    __cmd = nil
    __data = nil
    @arduino.on :sysex do |cmd, data|
      __cmd = cmd
      __data = data
    end

    @arduino.sysex 0x01, [13, 3, 2]

    100.times do
      sleep 0.1
      break if __cmd != nil
    end

    assert __cmd == 0x01
    assert __data == [13, 0, 3, 0, 2, 0]
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
arduino_firmata-0.2.8 test/test_sysex.rb
arduino_firmata-0.2.7 test/test_sysex.rb
arduino_firmata-0.2.6 test/test_sysex.rb
arduino_firmata-0.2.5 test/test_sysex.rb