From bf83d3331a0f5a7db858cd06cefc6127f023d9b3 Mon Sep 17 00:00:00 2001 From: Sho Hashimoto Date: Thu, 8 May 2014 19:37:00 +0900 Subject: [PATCH] bugfix pin number of event "digital_read" #38 --- lib/arduino_firmata/arduino.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/arduino_firmata/arduino.rb b/lib/arduino_firmata/arduino.rb index 958c920..e8c23ed 100644 --- a/lib/arduino_firmata/arduino.rb +++ b/lib/arduino_firmata/arduino.rb @@ -224,7 +224,7 @@ def process_input @digital_input_data[@multi_byte_channel] = input_data 0.upto(13).each do |i| next unless (0x01 << i) & diff > 0 - emit :digital_read, i, (input_data & diff > 0) + emit :digital_read, i+@multi_byte_channel*8, (input_data & diff > 0) end when ANALOG_MESSAGE analog_value = (@stored_input_data[0] << 7) + @stored_input_data[1]