INTERRUPT – ARM

Photo of author

By Jackson Taylor

int a=0;
                      void setup()
                      {
                        pinMode(PF_2, OUTPUT); //for blue led
                        pinMode(PF_3, OUTPUT); //for green led
                        pinMode(PUSH2, INPUT_PULLUP);
                        attachInterrupt(PF_0, blinky, FALLING); // Interrupt is fired whenever button is pressed
                                                               //  Here Blinky is interrupt service function
                      }
                      void loop()  //normally this loop plays 
                      {
                        digitalWrite(PF_2, 1); //blue LED starts ON
                        delay(1000);
                        digitalWrite(PF_2, 0); //blue LED starts Off
                        delay(1000);
                      }
                      void blinky() //this loop will excute when interrupt occur
                      {
                        a = !a;
                       digitalWrite(PF_3,a);  // output of green led will negate
                      }
See also
Bidirectional Operation of High Step-Down Converter 12V to 72vdc and 12vdc to 1.5dc

Revive Your Dead Electronics

Got a drawer full of dead gadgets or a failing car battery? Instead of paying a premium for replacements, use this simple trick to easily recondition them right from home.

See How It Works