2 Replies Latest reply on Dec 4, 2019 8:15 AM by BoBr_4596421

    Coding error in Training Video & Github code - PSoC6 101 - Lesson 2-2b

    BoBr_4596421

      Hi All,

      Any help with some coding would be greatly appreciated. I am relatively new to this, so the training videos have been a fantastic resource to help get going.

      I think there is an error in the above tutorial as it will not compile error-free.

      The first point to note is that the code on GitHub differs from the code in the video in some respects - I suppose this is normal catching up on errata.

       

      The main point of this thread is the following suspect line in the code

      "Cy_TCPWM_PWM_GetCompare0 (hw, cntrNum, percentToCompare(percentTmp) );"   (my speech marks).

       

      According to the PSoC Creator, this command should only have two arguments.

      This is the last line of code in "pwmTask.c"

       

      If I reduce it to two arguments by arbitrarily removing the argument "cntrNum", then the code compiles without error. I'm not convinced it runs correctly though as the motor status does not change when I send keyboard commands - but that's to be expected when you randomly delete code!

       

      GitHub reference is PSoC6-101-Video-Projects/pwmTask.c at master · cypresssemiconductorco/PSoC6-101-Video-Projects · GitHub

      Video reference is PSoC 6 101: Lesson 2-2b Implementing PWM into BLE Controlled Robotic Arm Project - YouTube

       

      Thanks in advance for any insights

      Bob