Sha256: 8f4831893b66bbc0c70c0b588c36bc6952d90be2d28cc4f7cca13dcee5bf3ada

Contents?: true

Size: 385 Bytes

Versions: 12

Compression:

Stored size: 385 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.on_analog_changed 0 do |value|
  puts "analog pin 0 changed #{value}"
  arduino.analog_write 11, value
end

led_stat = false
loop do
  arduino.digital_write 13, led_stat
  led_stat = !led_stat
  sleep 1
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
arduino_firmata-0.1.8 samples/on_changed.rb
arduino_firmata-0.1.7 samples/on_changed.rb
arduino_firmata-0.1.6 samples/on_changed.rb
arduino_firmata-0.1.5 samples/on_changed.rb
arduino_firmata-0.1.4 samples/on_changed.rb
arduino_firmata-0.1.3 samples/on_changed.rb
arduino_firmata-0.1.2 samples/on_changed.rb
arduino_firmata-0.1.1 samples/on_changed.rb
arduino_firmata-0.1.0 samples/on_changed.rb
arduino_firmata-0.0.9 samples/on_changed.rb
arduino_firmata-0.0.8 samples/on_changed.rb
arduino_firmata-0.0.7 samples/on_changed.rb