1. You have no pause in your main loop so you are polling the DS18B20 extremely fast. You may want to try a Pause 1000 (1second) in between you gosub start_Convert and your goto mainloop.
2. Your If/Then LED logic in start_Convert will only light the LED when the temperature is below 70 degF.
Tabsoft, Thanks...... I tried the pause but doesn't seem to have any effect. I have my LED reversed at the moment so low LED should actually turn it on when it gets above 70. Just for giggles I moved the LED up to GPIO.0 and it works perfectly. I think I am not initializing GPIO.2 correctly.... When I did have the LED blinking very dimly the blink seemed to corresponded to when the LCD was getting data sent to it on GPIO.1... it seemed to blink the same time the LCD would flash when updating. Perhaps I can't use GPIO.2 for an output to light the LED.
Originally Posted by Tabsoft
Just a couple of ideas.
1. You have no pause in your main loop so you are polling the DS18B20 extremely fast. You may want to try a Pause 1000 (1second) in between you gosub start_Convert and your goto mainloop.
2. Your If/Then LED logic in start_Convert will only light the LED when the temperature is below 70 degF.
Our dearly departed Darrell Taylor (world class programmer, *(my opinion)) left us with this little tidbit...
it's an include file that will set most any PIC's pins to "all digital"
just put this file in the same directory as your code and then put this line somewhere near the top of your code
Code:
INCLUDE ALLDIGITAL15.BAS
you may need to eliminate other attempts to turn off analog's so they don't confilict.
Note: the 15 in the file name indicates that it is his version 1.5
I hope this helps and that I haven't led you astray as I am not the greatest programmer
Dwight These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.
Perhaps I can't use GPIO.2 for an output to light the LED.
You can use GPIO.2 to light an LED if properly designed. I don't know much but I know that. Since you moved it to GPIO.0 and it worked then it should be designed correctly.
I think tabsoft has it right to change LED to LED var GPIO.2
Bookmarks