These should get you going
http://rentron.com/PicBasic/PBP1-wire.htm
and
http://rentron.com/PicBasic/one-wire2.htm
These should get you going
http://rentron.com/PicBasic/PBP1-wire.htm
and
http://rentron.com/PicBasic/one-wire2.htm
Dave
Always wear safety glasses while programming.
Sorry I'm still not really grasping the concept;
my current code looks simular to this
in picaxe
readtemp 0, b0 'storage cell 1 temp
readtemp 1, b1 'storage cell 2 temp
start:
let b0=b0+30 'simulate 30 degree celcius offset
if b0>b1 then 'check if storage cell 1 is more than cell 2
high 3 'open solenoid to transfer
endif
let b0=b0-30 'return b0 to true reading
in picbasic ive written it roughly like this but unsure how to do the readtemp part or i'm possibly completely wrong all together?
trisb.0=1
trisb.1=1
cell1temp var portb.0
cell2temp var portb.1
solenoid var portb.3
start:
let cell1temp = cell1temp +30
if cell1temp > cell2temp then
high solenoid
endif
let cell1temp = cell1temp - 30
Pretty much forget the picaxe stuff. It does not look like picaxe is comparable with PBP.
Follow the example I linked to for one-wire devices. Bruce gives the best explanation I know of.
Dave
Always wear safety glasses while programming.
MiskaA...
Here is another example on how to read the DS18B20 temp sensor... or several of them. This example is based on the same code that Mackrackit linked to.
http://www.picbasic.co.uk/forum/content.php?r=374-How-to-read-a-one-wire-DS18B20-temperature-sensor-or-nine-of-them
Last edited by Heckler; - 10th October 2011 at 20:33.
Dwight
These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.
Bookmarks