Skip to content

Instantly share code, notes, and snippets.

@vaclavbohac
Last active July 16, 2016 12:51
Show Gist options
  • Save vaclavbohac/cee31977f9417e7908a3eb612ea9d178 to your computer and use it in GitHub Desktop.
Save vaclavbohac/cee31977f9417e7908a3eb612ea9d178 to your computer and use it in GitHub Desktop.
Temperature measurement with arduino and TMP36
source "https://rubygems.org"
gem "dino", github: 'vaclavbohac/dino'
require 'bundler/setup'
require 'dino'
board = Dino::Board.new(Dino::TxRx::Serial.new)
sensor = Dino::Components::TemperatureSensor.new(pin: 'A0', board: board)
loop do
puts sensor.temperature.round(2)
sleep 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment