Sha256: df91ba6db571ea20ec3bd67330c7a15b4e2adef952cfc7402bf3c73abd02a3c1

Contents?: true

Size: 378 Bytes

Versions: 10

Compression:

Stored size: 378 Bytes

Contents

#usr/bin/env ruby
$:.unshift File.expand_path '../lib', File.dirname(__FILE__)
require 'rubygems'
require 'arduino_firmata'

arduino = ArduinoFirmata.connect ARGV.shift

arduino.pin_mode 2, ArduinoFirmata::INPUT

loop do
  if arduino.digital_read 2
    puts "on"
    arduino.digital_write 13, true
  else
    puts "off"
    arduino.digital_write 13, false
  end
  sleep 0.1
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
arduino_firmata-0.3.0 samples/digital_read.rb
arduino_firmata-0.2.9 samples/digital_read.rb
arduino_firmata-0.2.8 samples/digital_read.rb
arduino_firmata-0.2.7 samples/digital_read.rb
arduino_firmata-0.2.6 samples/digital_read.rb
arduino_firmata-0.2.5 samples/digital_read.rb
arduino_firmata-0.2.4 samples/digital_read.rb
arduino_firmata-0.2.3 samples/digital_read.rb
arduino_firmata-0.2.2 samples/digital_read.rb
arduino_firmata-0.2.1 samples/digital_read.rb