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++; } }