Sha256: b1ad21e28c236cab7574f795cc0dc0cde67cbeee603171370f12dca463cc0df5

Contents?: true

Size: 383 Bytes

Versions: 3

Compression:

Stored size: 383 Bytes

Contents

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

arduino = ArduinoFirmata::Arduino.new ARGV.shift

arduino.pin_mode 7, ArduinoFirmata::INPUT

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
arduino_firmata-0.0.3 samples/digital_read.rb
arduino_firmata-0.0.2 samples/digital_read.rb
arduino_firmata-0.0.1 samples/digital_read.rb