Sha256: 0171c1922f9b004461231b41323f31f2053bfcfad6864b78e19d6d4880d049ca

Contents?: true

Size: 548 Bytes

Versions: 1

Compression:

Stored size: 548 Bytes

Contents

require 'launchpad_mk2'

device = Launchpad::Device.new(:input => false, :output => true)

color = 0
# first page of colors
(0..7).each do |row|
  (0..7).each do |column|
    device.change :grid, :x => column, :y => row, :color => color
    color = color + 1
  end
end

sleep 2

# second page of colors
(0..7).each do |row|
  (0..7).each do |column|
    device.change :grid, :x => column, :y => row, :color => color
    color = color + 1
  end
end

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

device.reset_all()

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
launchpad_mk2-0.0.1 examples/colors.rb