Sha256: 51e2faac8a1af11d8439001e462b7013e20a4cdba91422d5c9484c6fc120fbdc

Contents?: true

Size: 527 Bytes

Versions: 22

Compression:

Stored size: 527 Bytes

Contents

# -*- coding: utf-8 -*-
require 'smalruby/hardware'

module Smalruby
  module Hardware
    # LEDを表現するクラス
    class Led < Smalrubot::Components::Led
      def initialize(options)
        super(board: world.board, pin: Pin.smalruby_to_smalrubot(options[:pin]))
      end

      # @!method turn_on
      # LEDをオンにする
      alias_method :turn_on, :on

      # @!method turn_off
      # LEDをオフにする
      alias_method :turn_off, :off

      def stop
        turn_off
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
smalruby-0.1.11-x86-mingw32 lib/smalruby/hardware/led.rb
smalruby-0.1.11 lib/smalruby/hardware/led.rb
smalruby-0.1.10-x86-mingw32 lib/smalruby/hardware/led.rb
smalruby-0.1.10 lib/smalruby/hardware/led.rb
smalruby-0.1.9-x86-mingw32 lib/smalruby/hardware/led.rb
smalruby-0.1.9 lib/smalruby/hardware/led.rb
smalruby-0.1.8-x86-mingw32 lib/smalruby/hardware/led.rb
smalruby-0.1.8 lib/smalruby/hardware/led.rb
smalruby-0.1.7-x86-mingw32 lib/smalruby/hardware/led.rb
smalruby-0.1.7 lib/smalruby/hardware/led.rb
smalruby-0.1.6-x86-mingw32 lib/smalruby/hardware/led.rb
smalruby-0.1.6 lib/smalruby/hardware/led.rb
smalruby-0.1.5-x86-mingw32 lib/smalruby/hardware/led.rb
smalruby-0.1.5 lib/smalruby/hardware/led.rb
smalruby-0.1.4-x86-mingw32 lib/smalruby/hardware/led.rb
smalruby-0.1.4 lib/smalruby/hardware/led.rb
smalruby-0.1.3-x86-mingw32 lib/smalruby/hardware/led.rb
smalruby-0.1.3 lib/smalruby/hardware/led.rb
smalruby-0.1.2-x86-mingw32 lib/smalruby/hardware/led.rb
smalruby-0.1.2 lib/smalruby/hardware/led.rb