Class: Smalruby::Hardware::Led

Inherits:
Dino::Components::Led
  • Object
show all
Defined in:
lib/smalruby/hardware/led.rb

Overview

LEDを表現するクラス

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Led

Returns a new instance of Led.



8
9
10
# File 'lib/smalruby/hardware/led.rb', line 8

def initialize(options)
  super(board: world.board, pin: Pin.smalruby_to_dino(options[:pin]))
end

Instance Method Details

#offObject

LEDをオフにする



18
19
20
# File 'lib/smalruby/hardware/led.rb', line 18

def stop
  off
end

#onObject

LEDをオンにする



# File 'lib/smalruby/hardware/led.rb', line 12

#stopObject

LEDをオフにする



18
19
20
# File 'lib/smalruby/hardware/led.rb', line 18

def stop
  off
end