|
i couldn't find it either. So i just played a little on a low voltage until I found it. Note: It must be grounded to work. Do you have to use the input statement or just the InX after you declared it once? I think this code should work, have tried it yet because I can't find a 9 pin serial cable. Does it sound right?
Input 0 'Low Pressure Setting for Minimum Pressure
Input 1 'High Pressure Setting for Maximum Pressure
Output 2
LastState VAR byte
Counter VAR nib
Check: 'If at or below Low pressure then turn on
Counter = Counter + 1
LastState = (LastState << 1) + In0
If Counter < 8 Then Check
Counter = 0
if LastState = 255 Then Run '8 in a row have been on (not Random)
LastState = 0
goto Check
Run: 'Run until High Pressure swith is open
if In1 = 0 then Full 'No signal - switch open
Out2 = 1
Goto Run
Full:
Out2 = 0
LastState = 0
goto Check
End
Last edited by nwagers : 08-07-2002 at 23:17.
|