Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use EventEmitter #17

Closed
shokai opened this issue Jan 12, 2013 · 0 comments
Closed

use EventEmitter #17

shokai opened this issue Jan 12, 2013 · 0 comments

Comments

@shokai
Copy link
Owner

shokai commented Jan 12, 2013

EventEmitter

http://shokai.github.com/event_emitter

  • analog_read
  • sysex_receive

analog

current

arduino.on_analog_changed 0 do |value|
  puts value  # => 0 ~ 1023
end

new

arduino.on :analog_read do |pin, value|
  puts "#{pin} -> #{value}"
end

sysex

current

arduino.on_sysex_received(0x01) do |data|
  puts "command : 0x01"
  puts "data    : #{data.inspect}"
end

new

arduino.on :sysex do |command, data|
  puts "command : #{command}"
  puts "data    : #{data.inspect}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant