I’m using the Xiao above (C6) mounted on the cool expansion board with the tiny display in the middle. I want to measure temperature with an 18B20 using the recommended Arduino IDE. So, I loaded the Dallas and One Wire libraries, and of course, it wouldn’t compile. So, I chased down the error and put the newest .h file in the One Wire library directory and it compiled, but it didn’t work.
I took the code example that everyone uses the first time, used pin 7 as the bus, and all I got back was the default -127 and -196 that usually indicates that the code didn’t see the 18B20.
So, I hunted the web looking for solutions and found another library, OneWireNg and loaded it. It compiled first time, but it didn’t work either. Same results.
So, I tried another sensor, same results. Then,instead of the waterproof sensor I want to use, I used one of the little ones, same results. In desperation, I chased the wires from the grove plug I used to the actual wires on the side of the C6 board. They checked out fine.
Yes, I have the resistor from 3.3 to the data line; that was the first thing I did.
Now, I may be a newby to the C6, but I’m not new to the 18B20, I’ve installed those things on a lot of devices to monitor temperatures from the heat sink on a large battery charger to the one inside my freezer; I have them controlling my A/C units. They ALL worked first try.
Not this time. Two different libraries and multiple sensors, same results. I even moved the 18B20 to pin 0 to see if that made a difference, same results.
What am I missing? Is there some secret to using one wire on the C6 that I missed in my hours of searching for answers. This really shouldn’t be hard.