SHARE
TWEET

Untitled

a guest Jul 16th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // returns number of milliseconds to wait till conversion is complete (based on IC datasheet)
  2. int16_t DallasTemperature::millisToWaitForConversion(uint8_t bitResolution) {
  3.  
  4.     switch (bitResolution) {
  5.     case 9:
  6.         return 94;
  7.     case 10:
  8.         return 188;
  9.     case 11:
  10.         return 375;
  11.     default:
  12.         return 750;
  13.     }
  14.      
  15. #include <OneWire.h>
  16. #include <DallasTemperature.h>
  17. #define ONE_WIRE_BUS A0
  18. OneWire oneWire(ONE_WIRE_BUS);
  19. DallasTemperature sensors(&oneWire);
  20.  
  21. void setup() {}
  22.  
  23. void loop () {
  24.     float currentTemp = sensors.getTempCByIndex(0);
  25.     sensors.requestTemperatures();
  26. }
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