Skip to content

Commit

Permalink
Merge pull request #33 from hybridgroup/dev
Browse files Browse the repository at this point in the history
Rubyserial
  • Loading branch information
zankich committed Jul 4, 2014
2 parents 8c9b344 + 424bb5e commit fb68b9f
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 93 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.rvmrc
.rbx
pkg
Gemfile.lock
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
language: ruby
rvm:
- 2.1.0
- 2.0.0
- 2.1.0
- 1.9.3
- jruby-1.7.9
- rbx-2.2.7
matrix:
allow_failures:
- rvm: jruby-1.7.9
- jruby
- rbx-2.2.10
script:
- bundle install
- bundle exec rake test
70 changes: 0 additions & 70 deletions Gemfile.lock

This file was deleted.

6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ Install the artoo-arduino gem:
$ gem install artoo-arduino
```

Install the hybridgroup-serialport gem:

```
$ gem install hybridgroup-serialport
```

Once plugged in, use the `artoo connect scan -t serial` command to find out your connection info and serial port address:

```
Expand Down
6 changes: 3 additions & 3 deletions artoo-arduino.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ Gem::Specification.new do |s|
s.extensions = ["ext/Rakefile"]

s.add_runtime_dependency 'artoo', '>= 1.6.0'
s.add_runtime_dependency 'artoo-gpio'
s.add_runtime_dependency 'artoo-i2c'
s.add_runtime_dependency 'artoo-gpio', '>= 0.4.1'
s.add_runtime_dependency 'artoo-i2c', '>= 0.5.0'
s.add_runtime_dependency 'hybridgroup-firmata', '>= 0.4.5'
s.add_development_dependency 'minitest', '~> 5.0'
s.add_development_dependency 'minitest-happy'
s.add_development_dependency 'minitest-happy', '~> 1.0.0'
s.add_development_dependency 'mocha', '~> 0.14.0'
end
2 changes: 1 addition & 1 deletion lib/artoo-arduino/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Artoo
module Arduino
VERSION = '1.4.3'
VERSION = '1.4.4'
end
end
9 changes: 2 additions & 7 deletions lib/artoo/adaptors/firmata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ def digital_read(pin)
end

# GPIO - analog
# NOTE pins are numbered A0-A5, which translate to digital pins 14-19
def analog_read(pin)
firmata.set_pin_mode(digital_pin(pin), ::Firmata::PinModes::ANALOG)
firmata.toggle_pin_reporting(digital_pin(pin))
firmata.set_pin_mode(firmata.analog_pins[pin], ::Firmata::PinModes::ANALOG)
firmata.toggle_pin_reporting(firmata.analog_pins[pin])
firmata.read_and_process

value = 0
Expand All @@ -67,10 +66,6 @@ def analog_read(pin)
value
end

def digital_pin(pin = 0)
pin + 14
end

# GPIO - PWM
def pwm_write(pin, level)
firmata.set_pin_mode(pin, ::Firmata::PinModes::PWM)
Expand Down
1 change: 1 addition & 0 deletions test/adaptors/firmata_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
it "#analog_read" do
@firmata_event.stubs(:name).returns(:analog_read_1)
@firmata_event.stubs(:data).returns([128])
@firmata.stubs(:analog_pins).returns([0,1])
@firmata.expects(:read_and_process)
@adaptor.analog_read(1).must_equal 128
end
Expand Down

0 comments on commit fb68b9f

Please sign in to comment.