Requirements

  • OSC library by Tadayoshi Funaba
  • Ruby 1.8.6

Example

# Turn on the LED on the Gainer I/O module while the button is pressed.
# Gainer I/Oモジュール上のボタンを押している間、LEDが点灯するサンプルです。
require 'funnel'

module Funnel
  gio = Gainer.new(Gainer::MODE1)

  gio.button.on PortEvent::RISING_EDGE do
    gio.led.value = 1.0
  end

  gio.button.on PortEvent::FALLING_EDGE do
    gio.led.value = 0.0
  end

  sleep(5)
end

Reference

http://funnel.cc/reference/ruby/


Language / 言語

Featured Pages

For Members

Not a member?