Sha256: 68ab18b11250f3d2be15ade2663ce6eb928cec734eca55787bfba3e1cc5b4fbc

Contents?: true

Size: 404 Bytes

Versions: 23

Compression:

Stored size: 404 Bytes

Contents

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

arduino = ArduinoFirmata.connect ARGV.shift
pin_num = 11

loop do
  puts "-"*10
  0.upto(255) do |i|
    puts i
    arduino.analog_write pin_num, i
    sleep 0.01
  end

  puts "-"*10
  255.downto(0) do |i|
    puts i
    arduino.analog_write pin_num, i
    sleep 0.01
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
arduino_firmata-0.3.0 samples/led_fade.rb
arduino_firmata-0.2.9 samples/led_fade.rb
arduino_firmata-0.2.8 samples/led_fade.rb
arduino_firmata-0.2.7 samples/led_fade.rb
arduino_firmata-0.2.6 samples/led_fade.rb
arduino_firmata-0.2.5 samples/led_fade.rb
arduino_firmata-0.2.4 samples/led_fade.rb
arduino_firmata-0.2.3 samples/led_fade.rb
arduino_firmata-0.2.2 samples/led_fade.rb
arduino_firmata-0.2.1 samples/led_fade.rb
arduino_firmata-0.2.0 samples/led_fade.rb
arduino_firmata-0.1.8 samples/led_fade.rb
arduino_firmata-0.1.7 samples/led_fade.rb
arduino_firmata-0.1.6 samples/led_fade.rb
arduino_firmata-0.1.5 samples/led_fade.rb
arduino_firmata-0.1.4 samples/led_fade.rb
arduino_firmata-0.1.3 samples/led_fade.rb
arduino_firmata-0.1.2 samples/led_fade.rb
arduino_firmata-0.1.1 samples/led_fade.rb
arduino_firmata-0.1.0 samples/led_fade.rb