8 years, 8 months ago.

My stm is not realizing any interrupts from external buttons, please help?

I am using stmnucleo L152RE. I tried analog as well s digital pins but the board is not taking any inputs from those buttons. But when I used the USERBUTTON as up button it realized both the buttons . when I use USERBUTTON as start interrupt it does not accept any input.

DigitalOut switchengine(PC_2);
DigitalIn pin_up(D4); 
DigitalIn pin_down(D8);
InterruptIn pin_start(PC_13);
 
//part of main code...
  int i= 0;
  pin_up.mode(PullDown);
  pin_down.mode(PullDown);
  pin_start.mode(PullDown);
  float time;
  
  lcd.locate(3,0);
  lcd.printf("SET TIME");
  
 do{
          if(pin_up==1)
           {i= i++;
           wait(0.1);
           if (i>200)
            i=200;
            time = i;
            if(i<4){
             lcd.cls();
             lcd.locate(1,0);
             lcd.printf("Time= %2.2f mn", time*15);
           
                          }

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32L152RET6 microcontroller.
Be the first to answer this question.