Sha256: 7f1248c00a3f33c7505753c5c9d67796cacf21ab35eaaa66f85f6e00980cc599

Contents?: true

Size: 519 Bytes

Versions: 1

Compression:

Stored size: 519 Bytes

Contents

require 'artoo'

# Circuit and schematic here: http://arduino.cc/en/tutorial/button

connection :digispark, :adaptor => :littlewire, :vendor => 0x1781, :product => 0x0c9f
device :board, :driver => :board
device :led, :driver => :led, :pin => 1
device :button, :driver => :button, :pin => 0, :interval => 0.01

work do
  puts "Firmware name: #{board.firmware_name}"
  puts "Firmware version: #{board.version}"
  puts "Press the button connected on pin #{button.pin}..."

  on button, :push    => proc { led.toggle }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
artoo-arduino-1.1.0 examples/littlewire_button_and_led.rb