Class: WiringPi::Modules::ModuleBase

Inherits:
Object
  • Object
show all
Defined in:
lib/wiringpi2.rb

Direct Known Subclasses

Mcp23017, Mcp23s17

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



27
28
29
# File 'lib/wiringpi2.rb', line 27

def name
  @name
end

#pin_baseObject (readonly)

Returns the value of attribute pin_base.



27
28
29
# File 'lib/wiringpi2.rb', line 27

def pin_base
  @pin_base
end

#pin_countObject (readonly)

Returns the value of attribute pin_count.



27
28
29
# File 'lib/wiringpi2.rb', line 27

def pin_count
  @pin_count
end

#pin_endObject (readonly)

Returns the value of attribute pin_end.



27
28
29
# File 'lib/wiringpi2.rb', line 27

def pin_end
  @pin_end
end

Instance Method Details

#newObject



29
30
31
32
# File 'lib/wiringpi2.rb', line 29

def new
  @pin_end = @pin_base + @pin_count
  updateName
end

#updateNameObject



34
35
36
# File 'lib/wiringpi2.rb', line 34

def updateName
  @name = ' at offset ' + @pin_base.to_s
end