- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello. Where can I read how to get the status of 1 button when using CapSense in PSoC4. In all examples only sliders and position finding.
I want to write a simple type code:
button = CapSense_GetButton(num_of_button); // coined command
if (button != 0)
{
// to do something
}
else
{
do something different
}
In CapSenseCSD component datasheet I can not find the right command.
Solved! Go to Solution.
- Labels:
-
PSoC 4 Architecture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am adapted https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjQvpi3ktbZ...
Its work)))))
int main()
{
CyGlobalIntEnable;
CapSense_Start();
CapSense_InitializeAllBaselines();
for(;;)
{
CapSense_UpdateEnabledBaselines();
CapSense_ScanEnabledWidgets();
while(CapSense_IsBusy() != 0)
{
//wait for the scanning
}
if (CapSense_CheckIsSensorActive(CapSense_SENSOR_BUTTON0__BTN))
{
LED_1_Write(0); /* enable LED */
}
else if(!CapSense_CheckIsSensorActive(CapSense_SENSOR_BUTTON0__BTN))
{
LED_1_Write(1); /* disable LED */
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am adapted https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjQvpi3ktbZ...
Its work)))))
int main()
{
CyGlobalIntEnable;
CapSense_Start();
CapSense_InitializeAllBaselines();
for(;;)
{
CapSense_UpdateEnabledBaselines();
CapSense_ScanEnabledWidgets();
while(CapSense_IsBusy() != 0)
{
//wait for the scanning
}
if (CapSense_CheckIsSensorActive(CapSense_SENSOR_BUTTON0__BTN))
{
LED_1_Write(0); /* enable LED */
}
else if(!CapSense_CheckIsSensorActive(CapSense_SENSOR_BUTTON0__BTN))
{
LED_1_Write(1); /* disable LED */
}
}
}