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 +4 -4
- data/lib/rotor/motor.rb +12 -20
- data/lib/rotor/version.rb +1 -1
- data/rotor.gemspec +1 -1
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cef1ab9b690175aeb72266ccd9ad3c6cdba2e049
|
4
|
+
data.tar.gz: 5602d17ba17365706aab8bc6e396dcc6737af84e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
65
|
-
|
66
|
-
|
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
|
-
@
|
69
|
-
|
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
|
-
|
76
|
-
|
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
data/rotor.gemspec
CHANGED
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.
|
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
|