This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

who can help me debug my code

Other Parts Discussed in Thread: TIDA-00254

hi~everyone

I do try to use a new blank project to simulate TIDA-00254_3D_Scanner_LCr4500_PGFlea3-1.1 projection Gray code. But I can not from the horizontal to the vertical projection, I can only compile the program to a level of 18 to the vertical projection 3, not very successfully projected to 18

https://www.youtube.com/watch?v=OXAZjMYrHf0
if (USB_IsConnected())
            USB_Close();
        USB_Open();
    LutEntry LutEntries[] = {
          {
    0,//int index
              0,        // int TrigType
             0,     // int PatNum
              1,        // int BitDepth
             1,     // int LEDSelect
              false,    // bool InvertPat
              true, // bool InsertBlack
              true, // bool BufSwap
             false  // bool trigOutPrev))
          },{
            0,//int index
            0,      // int TrigType
           1,       // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
          2,        // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
           3,       // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
           4,       // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
           5,       // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
           6,       // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
          7,        // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
           8,       // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
           9,       // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
           10,      // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
           0,       // int TrigType
           11,      // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
           12,      // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
           13,      // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
           14,      // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
           15,      // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
           16,      // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
           17,      // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
           18,      // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
           19,      // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
           20,      // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
          21,       // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
          22,       // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            0,//int index
            0,      // int TrigType
          23,       // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            false,   // bool BufSwap
           false    // bool trigOutPrev))
        }, {
                1,//int index
                0,      // int TrigType
              0,        // int PatNum
                1,      // int BitDepth
               1,       // int LEDSelect
                false,  // bool InvertPat
                true,   // bool InsertBlack
                true,   // bool BufSwap
               false    // bool trigOutPrev))
            },{
            1,//int index
            0,      // int TrigType
          1,        // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
            true,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            1,//int index
            0,      // int TrigType
          2,        // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
             false,   // bool BufSwap
           false    // bool trigOutPrev))
        },{
            1,//int index
            0,      // int TrigType
          3,        // int PatNum
            1,      // int BitDepth
           1,       // int LEDSelect
            false,  // bool InvertPat
            true,   // bool InsertBlack
             false,   // bool BufSwap
           false    // bool trigOutPrev))
        }
      };
       int NumberOfLutEntries = (sizeof(LutEntries) / sizeof(LutEntry));
       if (LCR_SetMode(true) < 0)                    // Pattern display mode
       {
           printf("Error LCR_SetMode\n");
           return;
       }
       if (LCR_PatternDisplay(0) < 0)                // Stop Pattern Display
       {
           printf("Error LCR_PatternDisplay\n");
           return;
       }
    //   if (LCR_SetInputSource(0, 1) < 0)           // FPD-Link, 24 bit
    //   {
    //       printf("Error LCR_SetInputSource\n");
    //       return;
    //   }
    //   if (LCR_SetPatternDisplayMode(true) < 0)    // FPD-Link
    //   {
    //       printf("Error LCR_SetPatternDisplayMode\n");
    //       return;
    //   }
       LCR_ClearPatLut();
       unsigned char splashLut[64];
       int numSplashLutEntries=0;
       for (int j = 0; j < NumberOfLutEntries; j++)
       {
           if (LCR_AddToPatLut(
               LutEntries[j].TrigType,
               LutEntries[j].PatNum,
               LutEntries[j].BitDepth,
               LutEntries[j].LEDSelect,
               LutEntries[j].InvertPat,
               LutEntries[j].InsertBlack,
               LutEntries[j].BufSwap,
               LutEntries[j].trigOutPrev
               ) < 0)
           {
               printf("Error LCR_AddToPatLut for index: %d\n", j);
               return;
           }
            splashLut[numSplashLutEntries++] = LutEntries[j].index;
       }
       if (LCR_SetPatternConfig(
           NumberOfLutEntries /*numLutEntries*/,
          0 /*repeat*/,
           NumberOfLutEntries /*numPatsForTrigOut2*/,
           numSplashLutEntries /*numSplashLutEntries*/) < 0)
       {
           printf("Error LCR_SetPatternConfig\n");
           return;
       }
       if (LCR_SetExposure_FramePeriod(EXPOSURE_PERIOD /*unsigned int exposurePeriod*/, FRAME_PERIOD /*unsigned int framePeriod*/) < 0)
       {
           printf("Error LCR_SetExposure_FramePeriod\n");
           return;
       }
       if (LCR_SetPatternTriggerMode(1) < 0)     // VSync triggers pattern
       {
           printf("Error Sending trigger Mode\n");
           return;
       }
       if (LCR_SendPatLut() < 0)
       {
           printf("Error LCR_SendPatLut\n");
           return;
       }
        // No clue what I'm doing here...
       if (LCR_SendSplashLut(&splashLut[1], numSplashLutEntries) < 0)
       {
           printf("Error Sending Image LUT");
           return;
       }
       unsigned int status;
       if (LCR_ValidatePatLutData(&status) < 0)
       {
           printf("Error validating LUT data\n");
           return;
       }