A robust and feature-complete Arduino library for Maxim Temperature Integrated Circuits.
Hardware Setup
Code Example
#include <OneWire.h> #include <DallasTemperature.h> // Data wire is connected to GPIO 4 #define ONE_WIRE_BUS 4 OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); void setup(void) { Serial.begin(9600); sensors.begin(); } void loop(void) { sensors.requestTemperatures(); delay(750); float tempC = sensors.getTempCByIndex(0); Serial.print("Temperature: "); Serial.print(tempC); Serial.println("°C"); delay(1000); }
getTempC(address)
and getTempF(address)
)You can slim down the code by defining the following at the top of DallasTemperature.h:
#define REQUIRESNEW // Use if you want to minimise code size #define REQUIRESALARMS // Use if you need alarm functionality📚 Additional Documentation
Visit our Wiki for detailed documentation.
If you want to contribute to the library development:
The project includes a development container configuration for VS Code that provides a consistent development environment.
Prerequisites
Development Commands Within the dev container, use:
arduino-build
- Compile the library and examplesarduino-test
- Run the test suitearduino-build-test
- Complete build and test processNote: Currently compiling against arduino:avr:uno environment
MIT License | Copyright (c) 2025 Miles Burton
Full license text available in LICENSE file.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4