AnsweredAssumed Answered

what does this "    test_indicator = nTestId % 7;"mean ?

Question asked by QQ123862905 on Dec 17, 2015
Latest reply on Dec 21, 2015 by blueskull

in the bf706 post demo , i find the code below

 

int PerformTest( int nTestId )    //进行test测试

{

    int nResult = 0;        /* result */

    int    nRound = 0;            /* which round does this test run in(测试处在第几次循环中) */

    int n = 0, m = 0;        /* indexes */

    int test_indicator;        /* test indicator(指示), with 3 LEDs only 0-7 */

 

    /* determine the test pattern */

    test_indicator = nTestId % 7; //取模 TODO

    if (0 == test_indicator)

    {

        if (0 != nTestId)

        {

            test_indicator = 7;

        }

    }

 

why is 7 in " test_indicator = nTestId % 7; " ?

Outcomes