Class: PiGPIO

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/pigpiod.rb,
lib/pi_gpio/gpio.rb,
lib/pi_gpio/errors.rb

Defined Under Namespace

Classes: Error, GPIO

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePiGPIO

Returns a new instance of PiGPIO.



14
15
16
17
18
19
# File 'lib/pigpiod.rb', line 14

def initialize
  @pigpio = File.open("/dev/pigpio", "wb")
  @pigout = File.open("/dev/pigout", "rb")

  @gpios = Array.new(54) { |g| GPIO.new(self, g) }
end

Instance Attribute Details

#gpiosObject (readonly)

Returns the value of attribute gpios.



12
13
14
# File 'lib/pigpiod.rb', line 12

def gpios
  @gpios
end

Instance Method Details

#inspectObject



21
22
23
# File 'lib/pigpiod.rb', line 21

def inspect
  "#<PiGPIO>"
end