Sha256: 2f3431e0fc076d225589d39c1fbddb87b6bb6fb085f19e534071dbdc29a8ff2d

Contents?: true

Size: 268 Bytes

Versions: 7

Compression:

Stored size: 268 Bytes

Contents

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

arduino = ArduinoFirmata.connect ARGV.shift

loop do
  an = arduino.analog_read 0
  puts an
  arduino.analog_write 11, an/4
  sleep 0.1
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
arduino_firmata-0.3.7 samples/analog_read_write.rb
arduino_firmata-0.3.6 samples/analog_read_write.rb
arduino_firmata-0.3.5 samples/analog_read_write.rb
arduino_firmata-0.3.4 samples/analog_read_write.rb
arduino_firmata-0.3.3 samples/analog_read_write.rb
arduino_firmata-0.3.2 samples/analog_read_write.rb
arduino_firmata-0.3.1 samples/analog_read_write.rb