Class: HumbleRPiPluginPiezoElements

Inherits:
Object
  • Object
show all
Defined in:
lib/humble_rpi-plugin-piezoelements.rb

Instance Method Summary collapse

Constructor Details

#initialize(settings: {}, variables: {}) ⇒ HumbleRPiPluginPiezoElements

Returns a new instance of HumbleRPiPluginPiezoElements.



11
12
13
14
15
# File 'lib/humble_rpi-plugin-piezoelements.rb', line 11

def initialize(settings: {}, variables: {})

  @gpio_pin = settings[:pin]
  
end

Instance Method Details

#on_exitObject



31
32
33
# File 'lib/humble_rpi-plugin-piezoelements.rb', line 31

def on_exit()
  @sounder.on_exit
end

#on_piezoelements_message(message) ⇒ Object



17
18
19
20
21
# File 'lib/humble_rpi-plugin-piezoelements.rb', line 17

def on_piezoelements_message(message)
          
  @sounder.buzz

end

#startObject Also known as: on_start



23
24
25
26
27
# File 'lib/humble_rpi-plugin-piezoelements.rb', line 23

def start()

  @sounder = RPiPDDB.new(@gpio_pin)  if @gpio_pin
  
end