Sha256: dac971a84e9f9fdeb2d08944115a793dbf177e4348e3d5caeeb1d6bd719be6e9

Contents?: true

Size: 406 Bytes

Versions: 7

Compression:

Stored size: 406 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

7 entries across 7 versions & 1 rubygems

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