input_bma180.rb 191 Bytes
class BMA180

  FILE = "/sys/bus/i2c/drivers/bma180/2-0041/coord"

  def self.read
    d = File.read(FILE).strip.split(",")[0..1].map(&:to_f).map{|v| v / 50_000}
    [-d[0], d[1]]
  end

end