Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- File: ds.lua --
- -- Paste bellow code to file --
- t = require("ds18b20")
- -- GPIO0 is pin 3
- pin = 3
- lasttemp = 0
- t.setup(pin)
- temperature=t.read()
- lasttemp = temperature * 1.8 + 320000
- t1 = lasttemp / 10000
- tempout=(string.format("%2d", t1)
- print("Temperature: "..tempout.."'F")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement