From d524d01876b8e3ef7c443ef032f2173150aef121 Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Sun, 21 May 2023 12:49:37 +0200 Subject: [PATCH] sync oneWireSearch with DS18B20_RT --- sketches/oneWireSearch/oneWireSearch.ino | 32 ++++++++++++++++-------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/sketches/oneWireSearch/oneWireSearch.ino b/sketches/oneWireSearch/oneWireSearch.ino index abe79c3d..69da95f7 100644 --- a/sketches/oneWireSearch/oneWireSearch.ino +++ b/sketches/oneWireSearch/oneWireSearch.ino @@ -4,27 +4,32 @@ // VERSION: 0.1.5 // PURPOSE: scan for 1-Wire devices + code snippet generator // DATE: 2015-june-30 +// URL: https://github.com/RobTillaart/DS18B20_RT // URL: http://forum.arduino.cc/index.php?topic=333923 // // inspired by http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html // -// Released to the public domain -// -// 0.1.00 initial version -// 0.1.01 first published version -// 0.1.02 small output changes -// 0.1.03 added more explicit range -// 0.1.04 added CRC check -// 0.1.5 fix do while loop (thanks pzygielo) -// UNO 2..20 -// MEGA and others have different range + +// HISTORY +// 0.1.00 initial version +// 0.1.01 first published version +// 0.1.02 small output changes +// 0.1.03 added more explicit range +// 0.1.04 added CRC check +// 0.1.5 fix do while loop (thanks pzygielo) + + +// UNO has pin 2..20 +// MEGA and others have different range const int startPin = 2; const int endPin = 20; + #include + void setup() { Serial.begin(115200); @@ -37,10 +42,12 @@ void setup() Serial.println("\n//\n// End oneWireSearch.ino \n//"); } + void loop() { } + uint8_t findDevices(int pin) { OneWire ow(pin); @@ -48,7 +55,6 @@ uint8_t findDevices(int pin) uint8_t address[8]; uint8_t count = 0; - if (ow.search(address)) { Serial.print("\nuint8_t pin"); @@ -84,3 +90,7 @@ uint8_t findDevices(int pin) return count; } + + +// -- END OF FILE -- +