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/CC2642R: XYZ Graphing GUI Composer Studio

Part Number: CC2642R

Tool/software: Code Composer Studio

Hello Ti Experts,

 

I have successfully completed the blinking LED tutorial using my CC2642R1 on the online GUI Composer Studio and I would now like to attempt to make a graph of the LED status. I am currently unsure about how to proceed with his implementation.

 

I have two volatile int variables, one set as LED(toggles from 0 to 1) and a counter(starts at 0 and increments every time the LED toggles). I would like to graph the counter as the x-axis and the LED as the y-axis. I have tried making my ‘value_-x’ as counter and ‘value_-y’ as LED but nothing happened. I’m thinking that the problem might be the data type needs to be an array but am not sure.

 

Thank you for your time! Here's my code:

/*
 *  ======== empty.c ========
 */

/* For usleep() */
#include <unistd.h>
#include <stdint.h>
#include <stddef.h>

/* Driver Header files */
#include <ti/drivers/GPIO.h>
// #include <ti/drivers/I2C.h>
// #include <ti/drivers/SDSPI.h>
// #include <ti/drivers/SPI.h>
// #include <ti/drivers/UART.h>
// #include <ti/drivers/Watchdog.h>

/* Board Header file */
#include "Board.h"
volatile int LED = 0;
volatile int counter= 0;

/*
 *  ======== mainThread ========
 */



void *mainThread(void *arg0)
{
    /* 1 second delay */
    uint32_t time = 1;

    /* Call driver init functions */
    GPIO_init();
    // I2C_init();
    // SDSPI_init();
    // SPI_init();
    // UART_init();
    // Watchdog_init();

    /* Configure the LED pin */
    GPIO_setConfig(Board_GPIO_LED0, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);

    /* Turn on user LED */
    GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_ON);

    while (1) {
        GPIO_toggle(Board_GPIO_LED0);
        LED= 0;
        sleep(time);
        counter++;
        GPIO_toggle(Board_GPIO_LED0);
        LED=1;
        sleep(time);
        counter++;
       
    }
}

  • Nick,

    There are a couple of different graph widgets supported by GUI Composer. The scalar graph plots one or more data points as a line of data on the graph. it is typically plotted periodically over time when using XDS JTAG target communications. The line graph plots arrays of data as lines on the graph. I believe this requires an array as the input value when binding. It sounds like your use-case would work better with scalar graph. Any customization beyond the basic functionality provided by the widget properties would require writing custom java scripts.