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.

CCS/CC2640R2F: CC2640R2F

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640

Tool/software: Code Composer Studio

Hello,

I am going through the tutorials for 'GUI Composer - JTAG_XDS model' with the CC2640 controller.  In doing the 'Empty' project and have completed it.  I would like to try to add an additional step, but cannot seem to get the GUI to correctly respond.  I had added an additional line of code seen below in bold:

if(adcValue >= threshold){
GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_ON);
GPIO_write(Board_GPIO_LED1, Board_GPIO_LED_OFF);
trigger = 1;

} else{
GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_OFF);
GPIO_write(Board_GPIO_LED1, Board_GPIO_LED_ON);
trigger = 0;
}

The attempt here is to add an additional LED light to the GUI Composer tutorial to reflect both LEDs on the CC2640 board.  

Note: I tried to add an additional declaration 'trigger1' in the code the same way trigger is defined.  However maybe it is more involved than I assume.

I am having issue adding the additional LED to function properly with what the board shows.  I am very new to programming and am trying to understand how the call outs in my code reflect in the GUI design. 

Thank you!

  • Ryan Allison said:
    I am going through the tutorials for 'GUI Composer - JTAG_XDS model' with the CC2640 controller.  In doing the 'Empty' project and have completed it. 

    Which tutorial exactly are you following or basing your example on? Can you provide a link or pointer to it?

  • Hello,

    Software > SimpleLink CC2640R2 SDK - v:1.50.00.58 > SimpleLink Academy -v:1.14.02.04 > Labs > TI Drivers > GUI Composer - JTAG_XDS model
  • Ryan Allison said:
    The attempt here is to add an additional LED light to the GUI Composer tutorial to reflect both LEDs on the CC2640 board.  

    In that case you would need to have two variables, so you can bind each of them to a LED widget in GUI Composer. Currently there is only one variable (trigger) tied to the LED widget in GUI Composer. 

    Define another global variable, say trigger1, and then try something like the following:

    if(adcValue >= threshold){
    GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_ON);
    trigger = 1;

    GPIO_write(Board_GPIO_LED1, Board_GPIO_LED_OFF);
    trigger1 = 0;


    } else{
    GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_OFF);
    trigger = 0;

    GPIO_write(Board_GPIO_LED1, Board_GPIO_LED_ON);
    trigger1 = 1;

    }

    Add another LED widget to GUI Composer and bind trigger1 to it.

    Hope this helps!