Class: Denko::Motor::A3967
Constant Summary
Behaviors::Lifecycle::CALLBACK_METHODS
Instance Attribute Summary collapse
#pin, #pins, #proxies
#board, #params
#state
Instance Method Summary
collapse
included
#convert_pins, #proxy_pin, #proxy_states, #require_pin, #require_pins
#initialize, #micro_delay
#update_state
Instance Attribute Details
#microsteps ⇒ Object
Returns the value of attribute microsteps.
17
18
19
|
# File 'lib/denko/motor/a3967.rb', line 17
def microsteps
@microsteps
end
|
Instance Method Details
#initialize_pins(options = {}) ⇒ Object
7
8
9
10
11
12
13
14
15
|
# File 'lib/denko/motor/a3967.rb', line 7
def initialize_pins(options={})
proxy_pin :step, DigitalIO::Output
proxy_pin :direction, DigitalIO::Output
proxy_pin :ms1, DigitalIO::Output, optional: true
proxy_pin :ms2, DigitalIO::Output, optional: true
proxy_pin :enable, DigitalIO::Output, optional: true
proxy_pin :slp, DigitalIO::Output, optional: true
end
|
#off ⇒ Object
33
34
35
|
# File 'lib/denko/motor/a3967.rb', line 33
def off
enable.high if enable
end
|
#on ⇒ Object
37
38
39
|
# File 'lib/denko/motor/a3967.rb', line 37
def on
enable.low if enable
end
|
#sleep ⇒ Object
25
26
27
|
# File 'lib/denko/motor/a3967.rb', line 25
def sleep
slp.low if slp
end
|
#step_ccw ⇒ Object
55
56
57
58
59
|
# File 'lib/denko/motor/a3967.rb', line 55
def step_ccw
direction.high unless direction.high?
step.high
step.low
end
|
#step_cw ⇒ Object
61
62
63
64
65
|
# File 'lib/denko/motor/a3967.rb', line 61
def step_cw
direction.low unless direction.low?
step.high
step.low
end
|
#wake ⇒ Object
29
30
31
|
# File 'lib/denko/motor/a3967.rb', line 29
def wake
slp.high if slp
end
|