So suppose I want to make indoor/ outdoor thermometers for all my family and friends as gifts. I'll have 2 DS18B20's on a bus in the design. How do I resolve which is the indoor one and which is the outdoor one?
So suppose I want to make indoor/ outdoor thermometers for all my family and friends as gifts. I'll have 2 DS18B20's on a bus in the design. How do I resolve which is the indoor one and which is the outdoor one?
Wouldn't it be obvious to them which temp was which? lol I don't know where your relatives live, but it's real easy to figure out here in Quebec.
Why burden yourself with labelling the temps? (if that is the reason of the question)
Robert
I do not see other method than reading the sensors ID and addressing them by their ID ...
but have to reprogram the chips if you change the sensor
the clever methods here are...
1) to use two ports instead of only one !!!
2) to have a routine that reads ONE sensor ID you have placed alone on the bus and makes it indoor one , then reads the second sensor you place later and make it the outdoor one ...
and so-on if a sensor change should occur one day.
3) use a normal sensor for outside and a ghost supply one for inside : it's possible to recognize them by software ...
Alain
Last edited by Acetronics2; - 8th December 2013 at 13:37.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
I put up my hypothetical question because I'm trying understand why you would ever use the whole serial number. If you want to build something that does not require human intervention on every restart, with multiple sensors and with the ability to swap one out if it fails, you can't use the full serial number as the method. So why would you bother to read anything beyond the family code? (other than academic interest)
I'm back to try and resolve this. I can not assign each temp sensor (6 of them) a different pin as the motherboard is already produced, I am just trying to improve things a little. So all I need to figure out is how to get an array into the select case:
I have tried:
but that does not workCode:SELECT CASE sensor CASE 1 :LOOKUP hexbyte,[STR sensor1\8], col
In my orginal code I have:
Lets say the array sensor1\8 is $28,$1E,$F5,$24,$03,$00,$00,$B8Code:Select Case sensor Case 1 :LOOKUP hexbyte,[$28,$1E,$F5,$24,$03,$00,$00,$B8], col
Hope this makes sense.
Should lookup have a : before it?
Bookmarks