lean code for DS2760 Thermocouple Kit
l8_apex_it
Posts: 16
I just picked up the DS2760 Thermocouple Kit along with a BS2P. Everything went great. I ran the demo source·code and was able to get it working. I then stripped much of the menu's and features I didn't need. I then added it to an existing program I have(which was small and uses RCtime and displays the reading to a 2x16 LCD display)· and it was out of variable space. So I did what I could and changed some of the variables from word to nib or byte where I could. I was able to get it working. My main concern is that I don't have much room for additional use.
I figure there are·some excellent programmers out there who are very efficient at coding. Has anyone written a subroutine·with minimal variables to read temperature from the DS2760?
More info... I am using the K thermocouple and obviously the Ktablepos.bpe
Thanks
I figure there are·some excellent programmers out there who are very efficient at coding. Has anyone written a subroutine·with minimal variables to read temperature from the DS2760?
More info... I am using the K thermocouple and obviously the Ktablepos.bpe
Thanks
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
I apologize if my post came across the wrong way. I was not criticizing the coding at all. I am a complete newbie and was hoping to use two of the DS2760's··(one for tank temperature and one room temperature) and use it to control my reef tank main lighting, cooling fans, LCD display, etc... After running the demo program last night and having the variable out of space message I had the realization that maybe I would not be able to do what I had wanted it to do. Just learning and not really having much experience I was assuming·that maybe some variables could be reused and that they were put in place to make it easier for newbies to see what was going on.
For example I eliminated tempf and changed tempf=....· to tempc=tempC.... in order to eliminate one variable and still convert the reading to Degrees F. I thought maybe more could be done along those lines.
Once again... I apologize if my post came across the wrong way. I appreciate the fact that there is demosource code provided. I am a hack and would have never got it working if it weren't for the demosource coding provided by Parallax and their wonderful documentation.
' something like this...
channel = 1
GOSUB DS2760
PUT tankTemp, Word result
channel = 2
GOSUB DS2760
PUT roomTemp, Word result
GET tankTemp, Word AA
GET roomTemp, Word BB
IF AA>BB THEN DEBUG "it's hot in here",CR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
You have multiple pages you could put parts of your program on
each page you can have new variables on each page.
I belive the BS2P has 8 pages of 2K each
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
DTQ
Post Edited (Paul Baker) : 3/10/2005 2:54:53 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA