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/TM4C1294NCPDT: Reading Data from PJ0 and PJ1 in tm4c1294ncpdt

Part Number: TM4C1294NCPDT

Tool/software: Code Composer Studio

Hi,

I am learning Tivaware c series TM4c1294xlNCPDT launchpad. I want to use the two switches which are placed on the launchpad at PJ0 and PJ1 and blink the leds present at PN0, PN1, PF0 and PF4.

When I do the blinking of LEDs without taking the input from the switches, they work properly but as soon as I put the APIs for GPIOPinRead() and GPIOPadConfigSet(), it builds properly but do not function when I press the switch. I have done padding at 4MA and Pull Down Configuration.

I have also tried the debugging part but the values from input pins are not changing. 

(I want the leds to be ON when I press PJ0 and OFF when I press PJ1. My board is EK-TM4C1294NCPDT)

Please help me to solve this problem.

  • Hello Madhavi,

    TivaWare examples include a buttons.c and buttons.h file which can be leveraged to make use of the LaunchPad buttons

    A simple example using these files can be seen by importing the Watchdog example from TivaWare into CCS.

    You will see API calls such as ButtonsInit and ButtonsPoll leveraged there.

    I would recommend using that to meet your application goals.

    Also, to use buttons.c/.h in your project, you will need to link those files to your CCS project. The following post will show you how (replacing the uartstdio files with the buttons files): e2e.ti.com/.../2787705