Ive written some test code using DT's example
Code:
INCLUDE "DT_INTS-14.bas" ; Base Interrupt System
INCLUDE "ReEnterPBP.bas" ; Include if using PBP interrupts
resolution var byte
x var byte
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler INT_INT, _ToggleLED1, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
@ INT_ENABLE INT_INT ; enable external (INT) interrupts
Main:
for resolution=0 to 100
pause 1
next
for resolution=100 to 0 step -1
pause 1
next
GOTO Main
'---[INT - interrupt handler]---------------------------------------------------
ToggleLED1:
for x=100 to 1 step -1
if resolution=x then
high portd.7
endif
pauseus 150
next
low portd.7
@ INT_RETURN
It works perfectly except the bulb fades out half way then pauses slightly then fades out completely. It also fades as its coming back in. Does anyone know why that is and how to fix it?
Bookmarks