Class: Raudi::AVR::Pin

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
PinStates
Defined in:
lib/raudi/avr/pin.rb

Constant Summary

Constants included from PinStates

Raudi::AVR::PinStates::DELIMITER

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PinStates

included, #state_number, #to_c

Constructor Details

#initialize(port, number, types) ⇒ Pin

Returns a new instance of Pin.



16
17
18
19
20
# File 'lib/raudi/avr/pin.rb', line 16

def initialize(port, number, types)
  self.port = port
  self.number = number
  load_states(types)
end

Instance Attribute Details

#numberObject

Returns the value of attribute number.



12
13
14
# File 'lib/raudi/avr/pin.rb', line 12

def number
  @number
end

#portObject

Returns the value of attribute port.



12
13
14
# File 'lib/raudi/avr/pin.rb', line 12

def port
  @port
end

Instance Method Details

#to_sObject



22
23
24
# File 'lib/raudi/avr/pin.rb', line 22

def to_s
  "Pin #{name}#{number} <#{state}>"
end