Please let me know if you know any good library for DS2482 I2C to 1-Wire bridge. I tried to use the DS2482_OneWire library but I got errors when trying to run the library examples (Read_temp_sensors and Scan_1Wire_Bus):
Error for Read_temp_sensors:
Read_temp_sensors:2:10: fatal error: DallasTemperature.h: No such file or directory
Error for Scan_1Wire_Bus:
Scan_1Wire_Bus
C:\Users\myuser\Documents\Arduino\libraries\DS2482_OneWire-master\OneWire.cpp: In member function 'uint8_t OneWire::waitOnBusy()':
C:\Users\myuser\Documents\Arduino\libraries\DS2482_OneWire-master\OneWire.cpp:121:3: error: 'delayMicroseconds' was not declared in this scope
delayMicroseconds(20);
^~~~~~~~~~~~~~~~~
exit status 1 Error compiling for board Arduino Nano.**
Thank you.
-
Please take a look at this library, github.com/mikaelpatel/Arduino-OWI. It handles both DS2482 and GPIO implementation. github.com/mikaelpatel/Arduino-OWI/blob/master/examples/DS2482/…Mikael Patel– Mikael Patel2020年02月05日 14:09:17 +00:00Commented Feb 5, 2020 at 14:09
-
The documentation may be found here, mikaelpatel.github.io/Arduino-OWI/dc/dfe/Hardware_2OWI_8h.html and mikaelpatel.github.io/Arduino-TWI/d4/d53/classDS2482.htmlMikael Patel– Mikael Patel2020年02月05日 14:14:03 +00:00Commented Feb 5, 2020 at 14:14
-
Thank you very much!Marian Tudor– Marian Tudor2020年02月06日 21:30:19 +00:00Commented Feb 6, 2020 at 21:30
1 Answer 1
I guess to solve the first error, you also need this library, which contains the DallasTemperature.h file. The file get's included, but is not contained in the DS2482 library. Unfortunately there is no clue for that in the readme of the library. The author didn't commit anything since 2014, so the development of the library can be considered dead from that side. Though some people have forked the library to make little changes.
And the solution to the second error is described in this issue of the DS2482 library (just adding an include of "Arduino.h" in the OneWire.cpp file).
-
Hello @chrisl, Thank you for your prompt answer. I don't know how to implement it: "// Constructor with no parameters for compatability with OneWire lib OneWire::OneWire()"... ecc " I still get an error for the second issue: bool isAllZeros(const uint8_t* const scratchPad, const size_t length = 9); ^~~~~~~~~~ Maybe you can still help me...Marian Tudor– Marian Tudor2020年02月06日 21:12:13 +00:00Commented Feb 6, 2020 at 21:12
-
Please include your current code into your question, then I can test this myselfchrisl– chrisl2020年02月06日 21:14:29 +00:00Commented Feb 6, 2020 at 21:14
-
Hello @chrisl. Thank's again for your time. Firstly I just want to run the examples included in the library. So the last error presented before was associated with Scan_1Wire_Bus. Please let me know if you are able to run all the ex file. Thank youMarian Tudor– Marian Tudor2020年02月08日 21:32:01 +00:00Commented Feb 8, 2020 at 21:32
-
I dowloaded the DS2482 library and also the Arduino-Temperature-Control library, as described in my answer. After adding
include "Arduino.h" to the top of OneWire.cpp I could successfully compile the example sketch
Scan_1Wire_Bus.ino` from the DS2482 library for the Arduino Nano. I use Arduino IDE 1.8.9chrisl– chrisl2020年02月08日 22:27:39 +00:00Commented Feb 8, 2020 at 22:27 -
Hello @chrisl.Unfortunately,for me is still not working.If I install only 2 libraries that you recommend before I'm getting errors when I'm using #include <DallasTemperature.h>.If I install the OneWire library directly from Manage Library I will not receive errors for the inclusion of "DallasTemperature.h": but I'm getting new errors I think because both libraries (DS2482/OneWire) has the same name "OneWire ".Because of this the object defineded in DS2482 are not visible anymore (class OneWire'has no member named 'checkPresence') Please let me know if I'm doing something wrong now . Thank youMarian Tudor– Marian Tudor2020年02月11日 21:06:47 +00:00Commented Feb 11, 2020 at 21:06