Class: RoboticArm::Led

Inherits:
Component show all
Defined in:
lib/robotic-arm.rb

Instance Method Summary collapse

Methods inherited from Component

#active?

Constructor Details

#initialize(robot_arm) ⇒ Led

Returns a new instance of Led.



215
216
217
218
219
# File 'lib/robotic-arm.rb', line 215

def initialize(robot_arm)  

  super(robot_arm)
  @switch = 2 
end

Instance Method Details

#offObject



222
# File 'lib/robotic-arm.rb', line 222

def off()          activate(@switch, -0x01) if on?               end

#on(seconds = 0) ⇒ Object



221
# File 'lib/robotic-arm.rb', line 221

def on(seconds=0)  activate(@switch,  0x01, seconds) unless on?  end