-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
89 additions
and
29 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Change Log DistanceTable | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/). | ||
|
||
|
||
## [0.2.1] - 2022-11-02 | ||
- add changelog.md | ||
- add rp2040 to build-CI | ||
|
||
|
||
## [0.2.0] - 2022-06-23 | ||
- fix #10 getTempCentiC() (thanks negroKiordi) | ||
- fix reading sensor | ||
|
||
---- | ||
|
||
## [0.1.7] - 2021-12-17 | ||
- update library.json | ||
- update license | ||
- minor edits | ||
|
||
## [0.1.6] - 2021-10-03 | ||
- add dependency | ||
- fix build-CI | ||
|
||
## [0.1.5] - 2021-06-16 | ||
- add retries parameter to begin() | ||
|
||
## [0.1.4] - 2021-05-26 | ||
- add OneWire.reset() to begin() | ||
|
||
|
||
## [0.1.3] - 2020-12-20 | ||
- add Arduino-CI + unit test | ||
|
||
## [0.1.2] - 2020-08-05 | ||
- refactor | ||
- sync with DS18B20 | ||
|
||
## [0.1.1] - 2019-??-?? | ||
|
||
## [0.1.0] - 2017-07-25 | ||
- initial version | ||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,25 @@ | ||
// | ||
// FILE: DS18B20_INT.cpp | ||
// AUTHOR: [email protected] | ||
// VERSION: 0.2.0 | ||
// VERSION: 0.2.1 | ||
// DATE: 2017-07-25 | ||
// PUPROSE: library for DS18B20 temperature sensor - integer only. | ||
// URL: https://github.com/RobTillaart/DS18B20_INT | ||
// https://github.com/RobTillaart/DS18B20_RT | ||
// | ||
// HISTORY: | ||
// 0.1.0 2017-07-25 initial version | ||
// 0.1.1 2019- | ||
// 0.1.2 2020-08-05 refactor / sync with DS18B20 | ||
// 0.1.3 2020-12-20 add Arduino-CI + unit test | ||
// 0.1.4 2021-05-26 add OneWire.reset() to begin() | ||
// 0.1.5 2021-06-16 add retries parameter to begin() | ||
// 0.1.6 2021-10-03 add dependency + fix build-CI | ||
// 0.1.7 2021-12-17 update library.json, license, minor edits | ||
// 0.2.0 2022-06-23 fix #10 getTempCentiC() (thanks negroKiordi) | ||
// fix reading sensor | ||
// HISTORY: see changelog.md | ||
|
||
|
||
#include "DS18B20_INT.h" | ||
|
||
// OneWire commands | ||
|
||
// OneWire commands | ||
#define STARTCONVO 0x44 | ||
#define READSCRATCH 0xBE | ||
#define WRITESCRATCH 0x4E | ||
|
||
|
||
// Device resolution | ||
// Device resolution | ||
#define TEMP_9_BIT 0x1F // 9 bit | ||
#define TEMP_10_BIT 0x3F // 10 bit | ||
#define TEMP_11_BIT 0x5F // 11 bit | ||
|
@@ -61,10 +52,10 @@ bool DS18B20_INT::begin(uint8_t retries) | |
_oneWire->reset(); | ||
_oneWire->select(_deviceAddress); | ||
_oneWire->write(WRITESCRATCH); | ||
// two dummy values for LOW & HIGH ALARM | ||
// two dummy values for LOW & HIGH ALARM | ||
_oneWire->write(0); | ||
_oneWire->write(100); | ||
_oneWire->write(_resolution); // lowest as we do only integer math. | ||
_oneWire->write(_resolution); // lowest as we do only integer math. | ||
_oneWire->reset(); | ||
} | ||
return _addressFound; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,26 +2,26 @@ | |
// | ||
// FILE: DS18B20_INT.h | ||
// AUTHOR: [email protected] | ||
// VERSION: 0.2.0 | ||
// VERSION: 0.2.1 | ||
// DATE: 2017-07-25 | ||
// PUPROSE: Minimalistic library for DS18B20 temperature sensor | ||
// uses only integer math (no float to minimize footprint) | ||
// URL: https://github.com/RobTillaart/DS18B20_INT | ||
// https://github.com/RobTillaart/DS18B20_RT | ||
|
||
// | ||
// BOTTOM VIEW | ||
// BOTTOM VIEW | ||
// | ||
// PIN MEANING | ||
// /---+ | ||
// / o | 1 GND | ||
// | o | 2 DATA | ||
// \ o | 3 VCC | ||
// \---+ | ||
// PIN MEANING | ||
// /---+ | ||
// / o | 1 GND | ||
// | o | 2 DATA | ||
// \ o | 3 VCC | ||
// \---+ | ||
// | ||
|
||
|
||
#define DS18B20_INT_LIB_VERSION (F("0.2.0")) | ||
#define DS18B20_INT_LIB_VERSION (F("0.2.1")) | ||
|
||
#include "Arduino.h" | ||
#include "OneWire.h" | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name=DS18B20_int | ||
version=0.2.0 | ||
version=0.2.1 | ||
author=Rob Tillaart <[email protected]> | ||
maintainer=Rob Tillaart <[email protected]> | ||
sentence=Library for DS18B20 restricted to a single sensor per pin. | ||
|