lib/plc/raspberrypi/raspberrypi_plc.rb in ladder_drive-0.5.1 vs lib/plc/raspberrypi/raspberrypi_plc.rb in ladder_drive-0.5.2

- old
+ new

@@ -39,21 +39,21 @@ end private def setup_io - @available_pi_piper = false + @available_pi_piper = true @io_dict = { inputs:[], outputs:[] } config[:io][:inputs].each do |dev, info| @io_dict[:inputs] << [device_by_name(dev), Pin.new(pin:info[:pin], direction: :in, pull:(info[:pull].to_sym || :off), invert:info[:invert])] end config[:io][:outputs].each do |dev, info| @io_dict[:outputs] << [device_by_name(dev), Pin.new(pin:info[:pin], direction: :out)] end - @available_pi_piper = true rescue NoMethodError puts "WARN: defention of io is missing!" rescue LoadError + @available_pi_piper = false puts "WARN: pi_piper is not available in this system!" end def sync_input if @available_pi_piper