+ Reply to Thread
Results 1 to 2 of 2

Thread: interrupt

  1. #1
    philipsi Newbie
    Join Date
    Dec 2003
    Posts
    26

    Default interrupt

    how to use interrupt on change on port b in BASIC? if there are four buttons connected to RB4-RB7 and also OR to RB0, if interrupt occurs, how to check which button is pressed?i really have great nightmare with this feature and my project gets stuck because of this.can anyone help me pleas


  2. #2
    Exo
    Exo is offline
    Exo Newbie
    Join Date
    Sep 2003
    Location
    Belgium
    Posts
    1,884

    Default Re: interrupt

    Quote Originally Posted by philipsi
    if interrupt occurs, how to check which button is pressed?
    Inside the interrupt routine simply poll RB4 - RB7 like you do with any normal input inside your software.

    something like this (for picbasic pro):

    IF PORTB.4 = 1 THEN
    ;do something
    ENDIF

+ Reply to Thread

Tags for this Thread