Class: Pigpio::Bank

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

Constant Summary collapse

Set =
{
  read: [:read_bank_1, :read_bank_2],
  clear: [:clear_bank_1, :clear_bank_2],
  set: [:set_bank_1, :set_bank_2]
}

Instance Method Summary collapse

Constructor Details

#initialize(pi, num) ⇒ Bank

Returns a new instance of Bank.



8
9
10
11
# File 'lib/pigpio/bank.rb', line 8

def initialize(pi, num)
  @pi = pi
  @num = num
end

Instance Method Details

#clear(bits) ⇒ Object



17
18
19
# File 'lib/pigpio/bank.rb', line 17

def clear(bits)
  IF.send(Set[:clear][@num], @pi, bits)
end

#readObject



13
14
15
# File 'lib/pigpio/bank.rb', line 13

def read
  IF.send(Set[:read][@num], @pi)
end

#set(bits) ⇒ Object



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

def set(bits)
  IF.send(Set[:set][@num], @pi, bits)
end