Class: RoboticArm::Led
Instance Method Summary collapse
-
#initialize(robot_arm) ⇒ Led
constructor
A new instance of Led.
- #off ⇒ Object
- #on(seconds = 0) ⇒ Object
Methods inherited from Component
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
#off ⇒ Object
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 |