lib/arduino_firmata/main.rb in arduino_firmata-0.2.7 vs lib/arduino_firmata/main.rb in arduino_firmata-0.2.8
- old
+ new
@@ -4,10 +4,10 @@
Dir.entries('/dev').grep(/tty\.?(usb|acm)/i).map{|fname| "/dev/#{fname}"}
end
def self.connect(serial_name=nil, params={}, &block)
serial_name = self.list[0] unless serial_name
-
+ raise Error.new 'Arduino not found' unless serial_name
Params.default.each do |k,v|
params[k] = v unless params[k]
end
arduino = Arduino.new serial_name, params