README.md in arduino_firmata-0.1.8 vs README.md in arduino_firmata-0.2.0
- old
+ new
@@ -59,12 +59,14 @@
Analog Read
```ruby
puts arduino.analog_read 0 # => 0 ~ 1023
-arduino.on_analog_changed 0 do |value|
- puts value # => 0 ~ 1023
+arduino.on :analog_read 0 do |pin, value|
+ if pin == 0
+ puts "analog pin #{pin} changed #{value}"
+ end
end
```
Servo Motor
```ruby
@@ -91,9 +93,21 @@
sleep 0.01
end
end
```
+Send Sysex Command
+```ruby
+arduino.sysex 0x01, [13, 5, 2]
+```
+
+Regist Sysex Command Event
+```ruby
+arduino.on :sysex do |command, data|
+ puts "command : #{command}"
+ puts "data : #{data.inspect}"
+end
+```
see samples https://github.com/shokai/arduino_firmata/tree/master/samples
Test
\ No newline at end of file