Sha256: 8f9119830a884b746571978fda2d85b0b9588d57a999dc854ac67133742df348

Contents?: true

Size: 722 Bytes

Versions: 5

Compression:

Stored size: 722 Bytes

Contents

require File.join(File.dirname(__FILE__), 'setup')

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

5 entries across 5 versions & 1 rubygems

Version Path
launchpad-0.2.2 examples/colors.rb
launchpad-0.2.1 examples/colors.rb
launchpad-0.2.0 examples/colors.rb
launchpad-0.1.1 examples/colors.rb
launchpad-0.1.0 examples/colors.rb