How to use Interrupts

Home Forums Microcontrollers PIC Microcontroller How to use Interrupts

This topic contains 0 replies, has 1 voice, and was last updated by  Maria Tanja 1 year, 2 months ago.

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.