- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Turn the LED on/off using the Cy_CapSense_IsProximitySensorActive () function provided for Proximity based on the Simple Proximity Sensor Demo posted earlier
The previous CE was a program that brightened and darkened the LED according to the distance. When using proximity sensing to turn the switch on and off, it is easy to use the provided Cy_CapSense_IsProximitySensorActive () function.
The program in the main.c file has been changed as follows.
-------------
static void process_touch(void)
{
uint32_t prox_status;
static led_data_t led_data = {LED_ON, LED_MAX_BRIGHTNESS};
prox_status = Cy_CapSense_IsProximitySensorActive (
CY_CAPSENSE_PROXIMITY0_WDGT_ID,
CY_CAPSENSE_PROXIMITY0_SNS0_ID,
&cy_capsense_context);
if((prox_status & 0x3) == 0){
led_data.state=LED_OFF;
}
else
{
led_data.state=LED_ON;
}
update_led_state(&led_data);
}
------------
Please use the one of Simple Proximity Sensor Demo (TARGET_CY8CKIT-062-BLE.zip) for CapSense and peripheral settings. Only the project is attached here.
Thanks,
Kenshow
- Labels:
-
PSoC 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Kenshow-san,
Thank you for sharing this project with the community. Appreciate your effort in creating this...
Best regards,
Hari