Sha256: 0a602fde03c13ceaa0fbc202766fcf03fdcb1c6e711a61b0ff3859bc31a66718

Contents?: true

Size: 416 Bytes

Versions: 2

Compression:

Stored size: 416 Bytes

Contents

module WhippedCream
  # A switch toggles a pin between on and off states
  class Switch < Control
    attr_reader :name, :pin

    def initialize(name, options = {})
      raise "Invalid pin.  The pin must be one of "\
            "the Raspberry Pi's valid GPIO pins: "\
            "#{VALID_GPIO_PINS}" unless VALID_GPIO_PINS.include?(options[:pin])

      @name = name
      @pin = options[:pin]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
whipped-cream-0.2.0.beta1 lib/whipped-cream/switch.rb
whipped-cream-0.1.1 lib/whipped-cream/switch.rb