class Omega2Gpio::Output

Public Class Methods

new(gpio_number) click to toggle source
Calls superclass method Omega2Gpio::Gpio::new
# File lib/omega2_gpio/output.rb, line 4
def initialize(gpio_number)
  super(gpio_number, "output")
end

Public Instance Methods

high() click to toggle source
# File lib/omega2_gpio/output.rb, line 20
def high
  set(1)
end
low() click to toggle source
# File lib/omega2_gpio/output.rb, line 24
def low
  set(0)
end
set(value) click to toggle source
# File lib/omega2_gpio/output.rb, line 8
def set(value)
  command = "fast-gpio set #{self.gpio_number} #{value}"
  if Omega2Gpio.configuration.mock
    mock_fast_gpio_command command
  else
    execute_fast_gpio_command command
  end
  @value = value

  self
end