Skip to content

Commit 953b0bf

Browse files
committed
merge miles/master + minor changes
1 parent e46ceec commit 953b0bf

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

DallasTemperature.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,9 +618,9 @@ int16_t DallasTemperature::calculateTemperature(const uint8_t* deviceAddress,
618618
extended resolution temperature can then be calculated using the
619619
following equation:
620620
621-
COUNT_PER_C - COUNT_REMAIN
621+
COUNT_PER_C - COUNT_REMAIN
622622
TEMPERATURE = TEMP_READ - 0.25 + --------------------------
623-
COUNT_PER_C
623+
COUNT_PER_C
624624
625625
Hagai Shatz simplified this to integer arithmetic for a 12 bits
626626
value for a DS18S20, and James Cameron added legacy DS1820 support.

examples/AlarmHandler/AlarmHandler.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ DallasTemperature sensors(&oneWire);
1414
DeviceAddress insideThermometer, outsideThermometer;
1515

1616
// function that will be called when an alarm condition exists during DallasTemperatures::processAlarms();
17-
void newAlarmHandler(uint8_t* deviceAddress)
17+
void newAlarmHandler(const uint8_t* deviceAddress)
1818
{
1919
Serial.println("Alarm Handler Start");
2020
printAlarmInfo(deviceAddress);
@@ -30,7 +30,7 @@ void printCurrentTemp(DeviceAddress deviceAddress)
3030
Serial.println();
3131
}
3232

33-
void printAddress(DeviceAddress deviceAddress)
33+
void printAddress(const DeviceAddress deviceAddress)
3434
{
3535
Serial.print("Address: ");
3636
for (uint8_t i = 0; i < 8; i++)
@@ -41,7 +41,7 @@ void printAddress(DeviceAddress deviceAddress)
4141
Serial.print(" ");
4242
}
4343

44-
void printTemp(DeviceAddress deviceAddress)
44+
void printTemp(const DeviceAddress deviceAddress)
4545
{
4646
float tempC = sensors.getTempC(deviceAddress);
4747
if (tempC != DEVICE_DISCONNECTED_C)
@@ -53,7 +53,7 @@ void printTemp(DeviceAddress deviceAddress)
5353
Serial.print(" ");
5454
}
5555

56-
void printAlarmInfo(DeviceAddress deviceAddress)
56+
void printAlarmInfo(const DeviceAddress deviceAddress)
5757
{
5858
char temp;
5959
printAddress(deviceAddress);

examples/Multiple/Multiple.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ DallasTemperature sensors(&oneWire);
1515
// arrays to hold device addresses
1616
DeviceAddress insideThermometer, outsideThermometer;
1717

18-
// Assign address manually. The addresses below will beed to be changed
18+
// Assign address manually. The addresses below will need to be changed
1919
// to valid device addresses on your bus. Device address can be retrieved
2020
// by using either oneWire.search(deviceAddress) or individually via
2121
// sensors.getAddress(deviceAddress, index)

examples/Timing/Timing.ino

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
//
22
// FILE: Timing.ino
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.0.2
4+
// VERSION: 0.0.3
55
// PURPOSE: show performance of DallasTemperature lib
66
// compared to datasheet times per resolution
77
//
88
// HISTORY:
9-
// 0.0.1 = 2017-07-25 initial version
10-
// 0.0.2 = 2020-02-13 updates to work with current lib version
9+
// 0.0.1 2017-07-25 initial version
10+
// 0.0.2 2020-02-13 updates to work with current lib version
11+
// 0.0.3 2020-02-20 added timing measurement of setResolution
1112

1213
#include <OneWire.h>
1314
#include <DallasTemperature.h>
@@ -39,7 +40,13 @@ void loop()
3940
Serial.println("RES\tTIME\tACTUAL\tGAIN");
4041
for (int r = 9; r < 13; r++)
4142
{
43+
start = micros();
4244
sensor.setResolution(r);
45+
Serial.println(micros() - start);
46+
47+
start = micros();
48+
sensor.setResolution(r);
49+
Serial.println(micros() - start);
4350

4451
uint32_t duration = run(20);
4552
float avgDuration = duration / 20.0;

0 commit comments

Comments
 (0)