How to use Interrupts

Home Forums Microcontrollers PIC Microcontroller How to use Interrupts

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #13917
    Maria Tanja
    Participant

    Hello,

    How to use interrupts to LED ON/OFF using push button. Am using 16Bit PICMicrocontroller dsPIC33. Please suggest how to write code..

     

    if (PORTBbits.RB5 == 1)

    {

    LATEbits.LATE6 = 1;

    }

     

     

     

    if (PORTBbits.RB5 == 1)

    {

    IFS1bits.CNIF = 1;

    IFS1bits.INT2IF = 1;

    IFS1bits.INT2IF = 1;

    IFS1bits.INT2IF = 0;

     

    }

    by using this code only switched ON….

     

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
>