Sha256: d361a7e7effa321f84486b0a486f976c3ba7114d5c9ea355104590b95a2f59e3

Contents?: true

Size: 396 Bytes

Versions: 3

Compression:

Stored size: 396 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
pin_num = 9

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

Version data entries

3 entries across 3 versions & 1 rubygems

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