Method: Neotrellis::Keypad#initialize

Defined in:
lib/neotrellis/keypad.rb

#initialize(seesaw, interrupt_pin: false, debug: false) ⇒ Keypad

Initialize the keypad driven by a Seesaw chip.

Parameters:

  • seesaw (Neotrellis::SeeSaw)

    Seesaw driver

  • interrupt_pin (Integer) (defaults to: false)

    GPIO pin used by the interruption handler. If false, the interruption mode will be disabled.

  • debug (Boolean) (defaults to: false)

    Enable debug ouput on stdout



82
83
84
85
86
87
88
# File 'lib/neotrellis/keypad.rb', line 82

def initialize(seesaw, interrupt_pin: false, debug: false)
  @seesaw = seesaw
  @debug = debug
  @callbacks = {}

  enable_interrupt(interrupt_pin) if interrupt_pin
end