I've been doing some more digging using Darrel Taylor's upgrade to the search engine: http://www.picbasic.co.uk/forum/showthread.php?t=4751
and found a nice description of another way to use A/D instead of ADCIN from Melanie that I am also going to try: http://www.picbasic.co.uk/forum/arch...php/t-352.html
I remember increasing the sample time to 100us before and maybe even more but it didn't make a difference. I'm sure if it's not configured right in the first place it wouldn't even matter! Man, am I glad that these devices are made to handle the all the flashing I can muster up.
One thing that's really bugging me, for lack of understanding, is that I have to keep the pot variable "Low_set" in the FOR/NEXT loop or else it won't give me the adjustable output. I thought that declaring Low_set = (ABS(low_adj-128))*8 once before going into the loop would be enough and that occasionally opening the door to let the flies in with ADCIN to update the variable "Low_set" would do the trick. BUT NOOO!!! I got the one read and it stayed fixed at that setting no matter how many flies I let in.
I gotta believe that it's possible to do what I'm trying to do. The tired part of me says "just show me how to do it!" but the bigger part thanks you guys for the clues and direction so I can learn to be a confident PBP programming dude.Code:Low_Add_pulse: IF low_adj<=127 THEN GOTO Low_Trim_pulse ' Check pot position and go FOR x = 1 to 10 ' Count to 10 FOR i = 1 to 100 ' Count to 100 IF Sig1=1 then ' Input OFF then: PAUSEUS low_set ' Adjustable delay using pot LOW Inj1 ' Turn OFF output ENDIF IF Sig1=0 THEN HIGH Inj1 ' Output ON if input ON NEXT i ADCIN 1, low_adj ' Check pot after a 100 loops ' for smooth adjustment NEXT x Low_set = (ABS(low_adj-128))*8 ' Declare every 1000 loops or ' adjustment not possible GOTO Low_Add_pulse ' Do it again
Thanks




Bookmarks