Hideto Naito

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: It does not enter an if statement #13042
    Hideto Naito
    Participant

    Hi,

    It works.
    Thanks a lot.

    in reply to: It does not enter an if statement #13028
    Hideto Naito
    Participant

    #include <mbed.h>

    /*sub routine registration———-*/

    void Blinky();
    void ActivateFlagLoop();
    DigitalOut myled(LED1);

    //Timer Setting
    Ticker intvTimer; // インターバルタイマ
    int BlinkCount = 0;

    bool FlagLoopFunction = false;
    /*mein program———————-*/
    int main()
    {
    //Cycle Setting

    intvTimer.attach_us(&ActivateFlagLoop, 10000); //100Hz
    while (true)
    {

    if (FlagLoopFunction) {
    //8msec

    //DebugOUT = true;

    FlagLoopFunction = false;

    Blinky();

    }
    else {
    }
    }
    }

    void Blinky()
    {
    BlinkCount += 1;
    if (BlinkCount > 50)
    {
    myled = !myled;
    BlinkCount = 0;
    }
    else
    {

    }
    }

    void ActivateFlagLoop() {

    if(!FlagLoopFunction) FlagLoopFunction = true;
    }

Viewing 2 posts - 1 through 2 (of 2 total)