rotor 0.0.6 → 0.0.7

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: 3cf88f9049feb8ff521853258e111d72f1f22d47
4
- data.tar.gz: 9836c93f42752ff2f2dca44452827d67d4b44147
3
+ metadata.gz: cef1ab9b690175aeb72266ccd9ad3c6cdba2e049
4
+ data.tar.gz: 5602d17ba17365706aab8bc6e396dcc6737af84e
5
5
  SHA512:
6
- metadata.gz: b0665868a8a31735bce1fb0aa1bde3d4081b5cddf1580c9c62de663cbde7708e29819473d185fe60ddaa6a3f66ea16b3da538fbd0f28e57f5690ede6e057722b
7
- data.tar.gz: 11f5c40470346c2f8652b9c9d2d4687951167a04008aa26184538a35598317deac31b5e2b28e85d1cf5ad1709bed60f8200521a5168ba7c0c18567ff026c7782
6
+ metadata.gz: 2ed5b1fe398742143a0961f6421757a623d51b0661c0f6e4d1e57158da07ec1f64fc0e85254d0ecff79fbe6c1f776c37bec3cbc0a07c61c8d88da3ceabbef753
7
+ data.tar.gz: 14a9e600d3b1685d17ff625217c23dfac9fb8ad127037238675c9e3584c8d5ad91e96f35aa171607ac0368e03cd74d34aeb5d03cec2aa1dd41a08c82c94c4fe2
data/lib/rotor/motor.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  require 'wiringpi'
2
- require 'pi_piper'
2
+ #require 'pi_piper'
3
3
 
4
4
  module Rotor
5
- include PiPiper
6
5
  class Stepper
6
+ include PiPiper
7
7
  def initialize(coil_A_1_pin, coil_A_2_pin, coil_B_1_pin, coil_B_2_pin, enable_pin=nil)
8
8
  @io = WiringPi::GPIO.new(WPI_MODE_GPIO)
9
9
  @coil_A_1_pin = coil_A_1_pin
@@ -61,28 +61,20 @@ module Rotor
61
61
  @io.write(@coil_B_2_pin, w4)
62
62
  end
63
63
 
64
- def set_home(x_coord=0, y_coord=0, x_homing_switch, y_homing_switch, x_homing_normally_open, y_homing_normally_open)
65
- x_homing_normally_open ? x_homing_logic = :high : x_homing_logic = :low
66
- y_homing_normally_open ? y_homing_logic = :high : y_homing_logic = :low
64
+ def set_home(coord=0, direction, homing_switch, homing_normally)
65
+ `echo #{homing_switch} > /sys/class/gpio/unexport`
66
+ @io.mode(homing_switch,INPUT)
67
+ @move = true
67
68
 
68
- @x_move = true
69
- @y_move = true
70
-
71
- while @x_move == true
72
- self.backwards(10,5)
69
+ while @move == true
70
+ backwards(10,5) if direction == :backwards && @io.read(homing_switch) == homing_normally
71
+ forward(10,5) if direction == :forward && @io.read(homing_switch) == homing_normally
73
72
  end
74
73
 
75
- while @y_move == true
76
- self.forward(10,5)
77
- end
78
-
79
- after :pin => x_homing_switch, :goes => x_homing_logic do
80
- @x_move = false
81
- end
74
+ #after :pin => homing_switch, :goes => homing_normally_open do
75
+ # @move = false
76
+ #end
82
77
 
83
- after :pin => y_homing_switch, :goes => y_homing_logic do
84
- @y_move = false
85
- end
86
78
  end
87
79
 
88
80
  end
data/lib/rotor/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rotor
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
data/rotor.gemspec CHANGED
@@ -22,5 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake", "~> 10.0"
23
23
 
24
24
  spec.add_dependency "wiringpi"
25
- spec.add_dependency "pi_piper"
25
+ #spec.add_dependency "pi_piper"
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rotor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - kobaltz
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: pi_piper
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  description: Ruby Gem for controlling Bipolar and Unipolar Stepper Motors
70
56
  email:
71
57
  - dave@k-innovations.net