Sha256: fd47fe304254ab22e9c7042222759098c39ca5bd1ab0f59526c18530124eea1e
Contents?: true
Size: 620 Bytes
Versions: 1
Compression:
Stored size: 620 Bytes
Contents
require 'artoo' # Circuit and schematic here: http://arduino.cc/en/Tutorial/Fade #connection :firmata, :adaptor => :firmata, :port => '/dev/tty*' connection :firmata, :adaptor => :firmata, :port => '127.0.0.1:8023' device :board, :driver => :board device :led, :driver => :led, :pin => 3 brightness = 0 fade_amount = 5 work do puts "Firmware name: #{board.firmware_name}" puts "Firmata version: #{board.version}" led.on every(0.05) do led.brightness(brightness) brightness = brightness + fade_amount if brightness == 0 or brightness == 255 fade_amount = -fade_amount end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
artoo-arduino-1.1.0 | examples/firmata_led_brightness.rb |