Class: OnionOmega::StepperSequencer
- Inherits:
-
Object
- Object
- OnionOmega::StepperSequencer
- Defined in:
- lib/onion_omega/stepper_sequencer.rb
Instance Attribute Summary collapse
-
#half_stepping ⇒ Object
Returns the value of attribute half_stepping.
-
#number_of_pins ⇒ Object
Returns the value of attribute number_of_pins.
Instance Method Summary collapse
-
#initialize(number_of_pins: 4, half_stepping: false) ⇒ StepperSequencer
constructor
A new instance of StepperSequencer.
- #pins_for_step(step) ⇒ Object
Constructor Details
#initialize(number_of_pins: 4, half_stepping: false) ⇒ StepperSequencer
Returns a new instance of StepperSequencer.
5 6 7 8 |
# File 'lib/onion_omega/stepper_sequencer.rb', line 5 def initialize(number_of_pins: 4, half_stepping: false) @number_of_pins = number_of_pins @half_stepping = half_stepping end |
Instance Attribute Details
#half_stepping ⇒ Object
Returns the value of attribute half_stepping.
3 4 5 |
# File 'lib/onion_omega/stepper_sequencer.rb', line 3 def half_stepping @half_stepping end |
#number_of_pins ⇒ Object
Returns the value of attribute number_of_pins.
3 4 5 |
# File 'lib/onion_omega/stepper_sequencer.rb', line 3 def number_of_pins @number_of_pins end |
Instance Method Details
#pins_for_step(step) ⇒ Object
10 11 12 |
# File 'lib/onion_omega/stepper_sequencer.rb', line 10 def pins_for_step(step) @half_stepping ? pins_for_half_step(step) : pins_for_full_step(step) end |