Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

PSoC™ 5, 3 & 1 Forum Discussions

Anonymous
Not applicable

Hey guys.

I'm fairly new to PSoC development. Just got a CY8CKIT-050 5LP Development Kit recently. I've been trying to control the brightness of an LED using the Capsense slider. I used the "CapSense CSD Design" code example to get started, and made some changes to include an output pin at P3[7] (connected to an external LED) , and a VDAC to convert the capsense position value to analog for the pin. I got the LED to turn on/off using the capsense buttons without using the VDAC. I was wondering if anyone could guide me on controlling the brightness of the led with the slider.

I've added some screenshots of my project.

pastedImage_1.png

pastedImage_2.png

Thank you.

0 Likes
1 Solution
ShanmathiN_06
Employee
Employee
25 likes received 10 likes received First like received

Hi,

The brightness of LED could be controlled with slider, using a PWM instead of VDAC.

The output of VDAC is not buffered. So, it is not recommended to use VDAC for driving LEDs.

PWM's duty cycle is to be varied according to the current slider position.

Use API PWM_WriteCompare(uint8/16 compare) in run time to modify the duty cycle accordingly, when the slider position changes.

Thanks,
Shanmathi

View solution in original post

0 Likes
1 Reply
ShanmathiN_06
Employee
Employee
25 likes received 10 likes received First like received

Hi,

The brightness of LED could be controlled with slider, using a PWM instead of VDAC.

The output of VDAC is not buffered. So, it is not recommended to use VDAC for driving LEDs.

PWM's duty cycle is to be varied according to the current slider position.

Use API PWM_WriteCompare(uint8/16 compare) in run time to modify the duty cycle accordingly, when the slider position changes.

Thanks,
Shanmathi

0 Likes