EDIT:WHAT WAS ACHIEVED IN THIS THREAD.
-new code to read temperature in 100ms (9-bit resolution)
-several codes to translate DS18B20's temp readings to degrees
I wan't to confirm, that I have thought right... (or wrong)
Most examples show someting like this.
Readtemp 1,b0
pause 750
use the result...
I think, why wait?
readtemp 1,b0
readtemp 2,b1
gosub test buttons pressed...
gosub do something else...
if still time left, THEN pause the rest of waiting time
use the results of readtemps
questions:
-I can use the command "readtemp" for several sensors in a row without pauses (it is the RESULTS that take time to form...) right or wrong? (difficulties to understand HOW intepreted commands work, WHAT is it, that takes time)
OR do I have to put pause between two readtemps from different ports/sensors?
-How to determine, how much a simple sub-procedure takes time (for example reading some input-pins,IF there is no input, which takes more time...)? ( = where to find info, how much different commands consume time)
I have earlier utilized DS1820 only on a PC, with Maxim's example code (Java,VBscript) and don't recall any "additional" pauses to wait for results...
(maybe delays were in the code, don't remember,but reading several sensor feeled quicker than n*750mS)
Earlier had electronics and computers as a hobby for a real long time... Programmed with Basic SOME rows So, Picaxe-basics "style" of doing things feels a bit alien... already several times had a risen bloodpressure, when quite usual, very much "habit" ways of basic-programming, result a "intepret error" on Picaxe... manual2 has been in keen use, but some answer can't be found there (for example this timing-thing for readtemp)
-new code to read temperature in 100ms (9-bit resolution)
-several codes to translate DS18B20's temp readings to degrees
I wan't to confirm, that I have thought right... (or wrong)
Most examples show someting like this.
Readtemp 1,b0
pause 750
use the result...
I think, why wait?
readtemp 1,b0
readtemp 2,b1
gosub test buttons pressed...
gosub do something else...
if still time left, THEN pause the rest of waiting time
use the results of readtemps
questions:
-I can use the command "readtemp" for several sensors in a row without pauses (it is the RESULTS that take time to form...) right or wrong? (difficulties to understand HOW intepreted commands work, WHAT is it, that takes time)
OR do I have to put pause between two readtemps from different ports/sensors?
-How to determine, how much a simple sub-procedure takes time (for example reading some input-pins,IF there is no input, which takes more time...)? ( = where to find info, how much different commands consume time)
I have earlier utilized DS1820 only on a PC, with Maxim's example code (Java,VBscript) and don't recall any "additional" pauses to wait for results...
(maybe delays were in the code, don't remember,but reading several sensor feeled quicker than n*750mS)
Earlier had electronics and computers as a hobby for a real long time... Programmed with Basic SOME rows So, Picaxe-basics "style" of doing things feels a bit alien... already several times had a risen bloodpressure, when quite usual, very much "habit" ways of basic-programming, result a "intepret error" on Picaxe... manual2 has been in keen use, but some answer can't be found there (for example this timing-thing for readtemp)
Last edited: