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.

MSP430FR2676: LED Lighting on Touchpads Using CapTIvate Technology

Part Number: MSP430FR2676

Tool/software:

Hello,

The CapTIvate Technology Guide introduces a method to light up an LED upon touch.
We have a customer requesting to implement this with Touchpads.
Are there any examples or cases where this has been successfully achieved?


<LEDs/LED Backlighting>
software-dl.ti.com/.../ch_design_guide.html

<Touchpads>
software-dl.ti.com/.../ch_design_guide.html


Best regards,
DDdoor

  • Hello DDdoor Slight smile

    Ok, if I understand the question, the SW to turn on an LED when touchpad is "touched" is same as any other type of sensor, say a button for example.

    If this is the case, I have uploaded the example code for the remote you see in the Captivate Technology guide (second link you provided above). 

    The code is in the file "trackpad_remote_demo.c in the attached .zip file". For convenience I posted the code below as well.  Specifically starting on line #82.

    /*
     * Trackpad_demo.c
     *
     * This file contains the sensor callbacks, UART and slave I2C communications handler
     * to support communications with host.
     * Note: See the modification to CAPT_commConfig.h on line #84 to enable both I2C and UART
     *
     *  Created on: Feb 9, 2017
     *      Author: a0272918
     */
    #include "captivate.h"
    #include "I2CSlave.h"
    #include "UART.h"
    #include "CAPT_BSP.h"
    #include <stdio.h>
    
    
    //======================== DEFINES ========================================
    #define FIRST_TOUCH             (pSensor->bSensorTouch == true) && (pSensor->bSensorPrevTouch == false)
    #define EXIT_TOUCH              (pSensor->bSensorTouch == false) && (pSensor->bSensorPrevTouch == true)
    #define MUTE                    (pSensor->pCycle[0]->pElements[0]->bTouch)
    #define ACTION                  (pSensor->pCycle[0]->pElements[1]->bTouch)
    
    //======================== VARIABLES =======================================
    bool bGripFlag = false;
    
    //=========================== CALLBACKS =======================================
    /*
     * GRIP CALLBACK
     * AUTOMATICALLY CALLED AFTER SENSOR IS PROCESSED
     * ADD APPLICATION SPECIFIC CODE HERE
     */
    void GripCallback(tSensor* pSensor)
    {
    
        if(FIRST_TOUCH)
        {
            LED1_ON;
            bGripFlag = true;
        }
        else if(EXIT_TOUCH)
        {
            LED1_OFF;
            bGripFlag = false;
        }
    }
    
    /*
     * BUTTON CALLBACK
     * AUTOMATICALLY CALLED AFTER SENSOR IS PROCESSED
     * ADD APPLICATION SPECIFIC CODE HERE
     */
    void ButtonCallback(tSensor* pSensor)
    {
    
        if(pSensor->bSensorTouch == true)
        {
            if(pSensor->pCycle[0]->pElements[0]->bTouch == true)
                LED3_ON;
            else
                LED3_OFF;
    
            if(pSensor->pCycle[0]->pElements[1]->bTouch == true)
                LED4_ON;
            else
                LED4_OFF;
    
        }
        else if((pSensor->bSensorPrevTouch == true) && (pSensor->bSensorTouch == false))
        {
            LED3_OFF;
            LED4_OFF;
        }
    }
    
    
    /*
     * TRACKPAD CALLBACK
     * AUTOMATICALLY CALLED AFTER SENSOR IS PROCESSED
     * ADD APPLICATION SPECIFIC CODE HERE
     */
    void TrackpadCallback(tSensor* pSensor)
    {
    
        if(pSensor->bSensorTouch == true)
            LED2_ON;
        else
            LED2_OFF;
    }
    
    
    void TrackPad_Demo_Init(void)
    {
        //
        // REGISTER THE BUTTON, GRIP AND TRACKPAD CALLBACKS HERE
        // REGISTERING THESE CALLBACKS ALLOWS THE USER FUNCTIONS
        // TO BE CALLED EACH TIME AFTER A SENSOR IS MEASURED REGARDLESSS
        // IF THE SENSOR IS TOUCHED OR NOT
        MAP_CAPT_registerCallback(&GRIP, &GripCallback);
        MAP_CAPT_registerCallback(&BUTTONS, &ButtonCallback);
        MAP_CAPT_registerCallback(&TKP00, &TrackpadCallback);
    }
    

    TOUCHPAD-5X5-FR2633-REMOTE-DEMO.zip

    Hope this helps.

  • Hello Dennis Lehman,

    Thank you for your support.

    I’m sorry for the delay in my response.

    As we have not received any response from the customer, we would like to request closing this case for the time being.

    Best regards,
    DDdoor

**Attention** This is a public forum