artoo-arduino 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 748c983bcdeff5ea53bdc5797cb525fe93395c7c
4
- data.tar.gz: 7ca12dea9832cc5a8d1eb4995587431ddab506b6
3
+ metadata.gz: 263138985ee324070ab6a1cee971d216d3c803f8
4
+ data.tar.gz: 67bd79ab8c8532f535f1b7570c23d0764918f88d
5
5
  SHA512:
6
- metadata.gz: 56c10bcc64d77fcd54f74323bb0cc41335fa2b7cb279854685a6011bd03b626641e7ea01e81575ade5ec448fe00f412fc45ad8f78c7d166d243d97cd35cc3833
7
- data.tar.gz: c0de064f9436b88aace158b260770657904da0441fd5ea7597f46157e738f7920ecff4ac246575688c0bb5ae9ff0dceaf1b69ada0eb5b9e131e46b665d0479b2
6
+ metadata.gz: bbfa986c0bca2d94bfac331e15cf9cfcd92001b66f9f959cf3d5325278ea5ed88ce161e321532527c336c64413d923cf08881e76fb326c6ca45e050bae5abb1b
7
+ data.tar.gz: 3014802fc3a1604c06c65745b609f86e60bb5eddf7a21d3c08b77319707a672f320df264821bc80a98057cbcd62c63b02ef1f310bebd41ef5f6205b8ea4302f7
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- artoo-arduino (1.0.3)
4
+ artoo-arduino (1.0.4)
5
5
  artoo (~> 1.0.0)
6
- hybridgroup-firmata (~> 0.4.4)
6
+ hybridgroup-firmata (~> 0.4.5)
7
7
 
8
8
  GEM
9
9
  remote: http://rubygems.org/
@@ -28,7 +28,7 @@ GEM
28
28
  certified
29
29
  http_parser.rb
30
30
  http_parser.rb (0.5.3)
31
- hybridgroup-firmata (0.4.4)
31
+ hybridgroup-firmata (0.4.5)
32
32
  event_emitter
33
33
  metaclass (0.0.1)
34
34
  method_source (0.8.2)
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.require_paths = ["lib"]
21
21
 
22
22
  s.add_runtime_dependency 'artoo', '~> 1.0.0'
23
- s.add_runtime_dependency 'hybridgroup-firmata', '~> 0.4.4'
23
+ s.add_runtime_dependency 'hybridgroup-firmata', '~> 0.4.5'
24
24
  s.add_development_dependency 'minitest', '~> 5.0'
25
25
  s.add_development_dependency 'minitest-happy'
26
26
  s.add_development_dependency 'mocha', '~> 0.14.0'
@@ -0,0 +1,28 @@
1
+ require 'artoo'
2
+
3
+ #Circuit's breadboard layout here: http://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/breadboard-layout
4
+
5
+ #connection :firmata, :adaptor => :firmata, :port => '/dev/tty*'
6
+ connection :firmata, :adaptor => :firmata, :port => '127.0.0.1:8023'
7
+ device :board
8
+ device :motor, :driver => :motor, :pin => [nil, nil, 3] # Needs a PWM pin
9
+
10
+ work do
11
+ board.connect
12
+ puts "Firmware name: #{board.firmware_name}"
13
+ puts "Firmata version: #{board.version}"
14
+
15
+ motor.stop
16
+ speed = 0
17
+ step = 50
18
+
19
+ every 4.seconds do
20
+ puts "Current speed: #{speed}"
21
+ motor.speed speed
22
+ speed += step
23
+ if [0, 250].include?(speed)
24
+ step = -step
25
+ end
26
+ end
27
+ end
28
+
@@ -11,10 +11,12 @@ work do
11
11
  puts "Firmware name: #{board.firmware_name}"
12
12
  puts "Firmata version: #{board.version}"
13
13
 
14
+ servo.move(0) # reset the position of the sweep (same as servo.min)
15
+
14
16
  every(2) do
15
17
  case servo.current_angle
16
- when 90 then servo.max
17
18
  when 0 then servo.center
19
+ when 90 then servo.max
18
20
  when 180 then servo.min
19
21
  end
20
22
  end
@@ -1,5 +1,5 @@
1
1
  module Artoo
2
2
  module Arduino
3
- VERSION = '1.0.3'
3
+ VERSION = '1.0.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: artoo-arduino
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ron Evans
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-08-21 00:00:00.000000000 Z
13
+ date: 2013-08-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: artoo
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - ~>
34
34
  - !ruby/object:Gem::Version
35
- version: 0.4.4
35
+ version: 0.4.5
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - ~>
41
41
  - !ruby/object:Gem::Version
42
- version: 0.4.4
42
+ version: 0.4.5
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: minitest
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -101,6 +101,7 @@ files:
101
101
  - examples/firmata_blink_led.rb
102
102
  - examples/firmata_blink_led_with_toggle.rb
103
103
  - examples/firmata_button_and_led.rb
104
+ - examples/firmata_dc_motor_speed.rb
104
105
  - examples/firmata_led_brightness.rb
105
106
  - examples/firmata_motor.rb
106
107
  - examples/firmata_servo.rb