Can't wait to return home... use the following ACDetect routine instead.
this should work.
Code:
disable
ACDetect:
if ACline==1 then
'
' Rising edge of AC signal
' ========================
if triacdelay then ' A delay is set by user
'
if FullBright==0 then ' Full Brightness flag is not set
pauseus maxdelay-triacdelay ' do the selected delay
triac=1 ' enable TRIAC
else '
triac=1 ' Full Brightness flag is set
' enable triac
endif '
'
else '
triac=0 ' No Delay set by user... disable Triac
endif '
else
'
' Falling edge of AC signal
' =========================
if fullbright==0 then triac=0 ' Disable the Triac on falling edge of
' Ac signal
endif
INTCON.0=0 ' Clear GPIF (interrupt on GP4 change)
resume
enable
Yeah i know you can also use Pulsout and forget the Falling edge detection... as you wish. Both will work.
Last edited by mister_e; - 18th December 2005 at 11:39.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks