SHARE
TWEET

Sensor DS18B20 com ATtiny85

Jorge_moises Jul 7th, 2017 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <OneWire.h>
  2. #include <DallasTemperature.h>
  3. #include <LiquidCrystal595.h>
  4.  
  5. #define ONE_WIRE_BUS 3
  6. OneWire oneWire(ONE_WIRE_BUS);
  7. LiquidCrystal595 lcd (8,9,10);
  8.  
  9. DallasTemperature sensors(&oneWire);
  10.  
  11. void setup(){
  12.   lcd.begin (16,2);
  13.   sensors.begin();
  14. }
  15.  
  16. void loop(){
  17.   sensors.requestTemperatures();
  18.   lcd.setCursor (0,0);
  19.   lcd.print("Temp: ");
  20.   lcd.print(sensors.getTempCByIndex(0));  
  21.   delay(3000);
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top