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.

ButtonsPoll()

Other Parts Discussed in Thread: EK-TM4C123GXL

Where can I find a tutorial for ButtonsPoll and Button_Pressed API's?

  • Hello Vikas,

    The prototype can be found in drivers for every board examples. There is no tutorial document as such.

    C:\ti\TivaWare_C_Series-2.1.0.12573\examples\boards\ek-tm4c123gxl-boostxl-senshub\drivers

    Regards

    Amit

  • Hi I what you said but an error is still running

    "C:/ti/TivaWare_C_Series-2.1.0.12573/examples/boards/ek-tm4c123gxl/drivers/buttons.c", line 35: fatal error #1965: cannot open source file "drivers/buttons.h"
    1 catastrophic error detected in the compilation of "C:/ti/TivaWare_C_Series-2.1.0.12573/examples/boards/ek-tm4c123gxl/drivers/buttons.c".
    Compilation terminated.
    gmake: *** [buttons.obj] Error 1

    I hope you could help me
  • Hello Luis

    Is the include file path mapped in the compilation flow? Please check the compile log for include path

    Regards
    Amit
  • could you give me your e-mail, i want to show you some images, i really need to continue learning how to use my tiva
  • Hello Luis

    You can post it on the forum

    Regards
    Amit
  • hello i could erase the other error but now i have other hope you could help me this is the code

    #include <stdint.h>
    #include <stdbool.h>
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/gpio.h"
    #include "examples\boards\ek-tm4c123gxl\drivers\buttons.h"


    int PinData=2;
    unsigned char ucDelta = 0;
    unsigned char ua = 0;
    unsigned char ucState =0;


    int main(void)
    {
    SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);

    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
    while(1)
    {
    ucState = ButtonsPoll(&ucDelta, &ua);
    if (BUTTON_PRESSED(LEFT_BUTTON, ucState, ucDelta))
    {
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, PinData);
    SysCtlDelay(40000000);
    GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x00);
    SysCtlDelay(40000000);
    //if(PinData==8) {PinData=2;} else {PinData=PinData*2;}
    }
    else {GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x0E);}
    }
    }

    and these are the erros

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "lab3.out" not built

  • Hello Luis,

    It seems that the driverlib.lib has not been included during link time.

    Regards
    Amit