Last active
July 16, 2016 12:51
-
-
Save vaclavbohac/cee31977f9417e7908a3eb612ea9d178 to your computer and use it in GitHub Desktop.
Temperature measurement with arduino and TMP36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
gem "dino", github: 'vaclavbohac/dino' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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