Sha256: 2349f7403a0dbf3151ceb1bac6062f71bdc290bcd6f4ee8fa0179680d80e2165

Contents?: true

Size: 596 Bytes

Versions: 1

Compression:

Stored size: 596 Bytes

Contents

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

class TestArduinoFirmata < MiniTest::Unit::TestCase

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

  def test_arduino
    assert @arduino.version > '2.0'
    @arduino.close
  end

  def test_analog_read
    0.upto(5).each do |pin|
      ain = @arduino.analog_read pin
      assert 0 <= ain and ain < 1024
    end
    @arduino.close
  end

  def test_digital_read
    0.upto(13).each do |pin|
      din = @arduino.digital_read pin
      assert [true,false].include? din
    end
    @arduino.close
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
arduino_firmata-0.1.7 test/test_arduino_firmata.rb