I have just set up a layout and a draft programe for a couple of dallas sensors, but the resultant serial print out reads:
"Hi!
Temp0 = -127.00 Temp1 = -127.00Hi!
Temp0 = -127.00 Temp1 = -127.00Hi!"
The temp (which should show a comfortable room temp) does not vary with time. What might I have got wrong??
Any help would be appreciated.
Colin.
Draw schematic with pen & paper of how you wired them , take a photo with a cell phone and post that with your code.
The value -127 is an indication of the DTCLib that the communication went wrong.
So it seems that the code is working properly but there is something wrong with the hardware connection.
- wrong pin?
- no pull up resistor?
- wrong mode?
- interference?
- loose wiring?
So follow raschemmels advice and send us at least the schematic.
And the code if you want help. Without both of those there is nothing we can do but say, "oh, that's a shame..." =(
Very grateful for your comments.
I am very much a beginner and even simple things can elude me time to time. My apopogies for not seeing the obvious. In this case, it seems that by moving to to a new and unused part of the breadboard (unused) I tightened up the connections - and then everything worked! So, now I get this from my code:
"Temp0 = 21.50 Temp1 = 21.00Hi!
Temp0 = 21.50 Temp1 = 21.00Hi!
Temp0 = 22.00 Temp1 = 23.00Hi!
Temp0 = 22.50 Temp1 = 24.50Hi!"
And with a modified code, even managed to get addresses:
"Requesting temperatures...DONE
2.46
Device Address: 28B49BA90500000D Temp C: 21.00 Temp F: 69.80
Device Address: 28A19DA905000021 Temp C: 20.50 Temp F: 68.90
Device Address: 28C3CAA8050000C7 Temp C: 21.00 Temp F: 69.80
Requesting temperatures...DONE"
Someone needed to point out the obvious!
Many thanks,
Colin.