Class: RoboticArm::Base
- Inherits:
-
ComponentMoving
- Object
- Component
- ComponentMoving
- RoboticArm::Base
- Defined in:
- lib/robotic-arm.rb
Instance Method Summary collapse
-
#initialize(robot_arm) ⇒ Base
constructor
A new instance of Base.
- #left(seconds = 0) ⇒ Object
- #right(seconds = 0) ⇒ Object
Methods inherited from ComponentMoving
Methods inherited from Component
Constructor Details
#initialize(robot_arm) ⇒ Base
Returns a new instance of Base.
294 295 296 297 |
# File 'lib/robotic-arm.rb', line 294 def initialize(robot_arm) super(robot_arm) @switch = 1 end |
Instance Method Details
#left(seconds = 0) ⇒ Object
299 300 301 302 303 |
# File 'lib/robotic-arm.rb', line 299 def left(seconds=0) return if @active and @moving == :left activate(@switch, @val=0x02, seconds) @moving = :left end |
#right(seconds = 0) ⇒ Object
305 306 307 308 309 |
# File 'lib/robotic-arm.rb', line 305 def right(seconds=0) return if @active and @moving == :right activate(@switch, @val=0x01, seconds) @moving = :right end |