Class: OnionOmega::StepperSequencer

Inherits:
Object
  • Object
show all
Defined in:
lib/onion_omega/stepper_sequencer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_steppingObject

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_pinsObject

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