Sha256: 7a8759967ec9bdbe944d6b57a6c048e3bf7c63a0d15bab768f81f1ed76cbe129

Contents?: true

Size: 691 Bytes

Versions: 2

Compression:

Stored size: 691 Bytes

Contents

require 'launchpad'

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

pos_x = pos_y = 0
4.times do |red|
  4.times do |green|
    device.change :grid, :x => pos_x, :y => pos_y, :red => red, :green => green
    device.change :grid, :x => 7 - pos_x, :y => pos_y, :red => red, :green => green
    device.change :grid, :x => pos_x, :y => 7 - pos_y, :red => red, :green => green
    device.change :grid, :x => 7 - pos_x, :y => 7 - pos_y, :red => red, :green => green
    pos_y += 1
    # sleep, otherwise the connection drops some messages - WTF?
    sleep 0.01
  end
  pos_x += 1
  pos_y = 0
end

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

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
mrjoy-launchpad-0.4.0 examples/colors.rb
launchpad-0.3.0 examples/colors.rb