Sha256: 10aefb9069319c0096a74dca4cac64a6112851ab5698cfb7a84491bb111a0744

Contents?: true

Size: 612 Bytes

Versions: 1

Compression:

Stored size: 612 Bytes

Contents

require 'launchpad_mk2'

interaction = Launchpad::Interaction.new

# yellow feedback for grid buttons
interaction.response_to(:grid, :down) do |interaction, action|
  interaction.device.change(:grid, :x => action[:x], :y => action[:y], :color => 13)
end

# mixer button terminates interaction on button up
interaction.response_to(:mixer) do |interaction, action|
  interaction.device.change(:mixer, :color => action[:state] == :down ? 5 : 61)
  interaction.stop if action[:state] == :up
end

# start interacting
interaction.start

# sleep so that the messages can be sent before the program terminates
sleep 0.1

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
launchpad_mk2-0.0.1 examples/drawing_board.rb