Method: Neotrellis::Keypad#wait_for_event
- Defined in:
- lib/neotrellis/keypad.rb
#wait_for_event ⇒ Object
Wait for an interruption and process all pending event. The interruption mode must be enabled for this method to work. This is a blocking method. Use ‘resume()` inside a callback to stop waiting.
170 171 172 173 |
# File 'lib/neotrellis/keypad.rb', line 170 def wait_for_event raise "Interrupt is not enabled. Setup enable_interrupt() first" unless interrupt? YaGPIO::wait([@gpio]) end |