Quantcast
Channel: MEL PICBASIC Forum
Viewing all articles
Browse latest Browse all 4745

Using an interrupt for an input

$
0
0
I'm using DT's interrupt code to blink some LED's at a constant rate and it works awesome. I'd like to use this code to check some hardware and software inputs but I can't get it to work.

First question - If I'm using DT's interrupt code to check software or hardware inputs, can I use timers zero, one, two and three? (18F4550)

Second question - The code I'm using on the interrupts is:
Code:

'---[INT - interrupt handler]---------------------------------------------------
Toggleinput1:
    if PORTB.5=0 THEN
        TOGGLE LED_RX
        GOTO RECEIVING_DATA
    ENDIF
@ INT_RETURN

Is this the correct way to check an input?

Viewing all articles
Browse latest Browse all 4745

Trending Articles