Hi,
May be
instead ofCode:Loop:result = result - 1 :if PORTD.0 && result.11 then Loop'
... here it compiles !Code:Loop: result = result - 1 : if PORTD.0 & result.bit11 then Loop
may be you're not LOGICAL enough ... LoL !
Alain
Hi,
May be
instead ofCode:Loop:result = result - 1 :if PORTD.0 && result.11 then Loop'
... here it compiles !Code:Loop: result = result - 1 : if PORTD.0 & result.bit11 then Loop
may be you're not LOGICAL enough ... LoL !
Alain
************************************************** ***********************
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 " !!!
*****************************************
Excellent help guys. Compiled with the && so I learned something new today....... but now I just get 16 on Humidity and Temp. I have a 10K pull up resistor on the DATA pin of the SHT71, and the leads are about 5cm long. I found that the program stops here:
ReadSensor: gosub TransferStart : gosub WaitSensor
shiftout dpin,cpin,0,[Sensorcmd\8]
input dpin : cpin = 0
while dpin = 1 : wend
cpin = 1 : pause 1 : cpin = 0
while dpin = 0 : wend '<-----------------program stops here
so obviously the Data pin is not doing what its told to. Any more ideas out there???
How do you know the data pin isn't doing what it's told to do?
How do you know that the sensor received the Sensorcmd correctly in the first place to trigger it to kick back some data at you? Do you even have to wait for the dpin to go low and/or high? How about just pausing for a bit longer and see what happens?
All good questions............let me stick some LED's in there and see whats going on then
This is now officially doing my head in.....pause 10 in place of WEND gives a temp of 4000 and a humidity of 65071. methinks this is not working for me, and my sanity quotient has dramatically decreased these last few days.
Well, then get rid of all that crazy math (ok, it's really not that crazy, but it does increase the chance of a logical error of some sort) you've got going on, read raw values and see if anything at all makes sense.
Put the sensor in ice water, run the program, read the value.
Put the sensor in really hot water, run the program, read the value, see if the temp rises by something that's reasonable, like say you went from ice to boiling, the temp sensor might rise by 100 (or 212 depending on your units). And the humidity would surely rise a bunch too. Then maybe put the sensor in a bunch of dessicant, to dry it out really good and see what the humidity output reads.
That 4000 you've got might be 40.00C (doubt it, but anything's possible), that 65071 might be 65.071%RH (again, doubt it, but, you know...).
Bookmarks