Sha256: d356325576d5359ff7158426add39b8b4aedb2bb8a1e0fdef005cae744adfdba
Contents?: true
Size: 549 Bytes
Versions: 5
Compression:
Stored size: 549 Bytes
Contents
require 'bundler/setup' require 'firmata' #sp = 'COM3' # windows #sp = '/dev/ttyACM0' #linux sp = '/dev/tty.usbmodemfa131' #mac board = Firmata::Board.new(sp) board.connect puts "Firmware name #{board.firmware_name}" puts "Firmata version #{board.version}" rate = 0.5 address = 0x52 board.on :i2c_reply do |value| puts value end board.i2c_config(0) board.i2c_write_request(address, 0x40, 0x00) while true do board.i2c_write_request(address, 0x00, 0x00) board.i2c_read_request(address, 6) board.read_and_process sleep 0.2 end
Version data entries
5 entries across 5 versions & 1 rubygems