How to get the white value in the RGBW lamp by the x and y values

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get the white value in the RGBW lamp by the x and y values

803 Views
yuboli
Contributor II

I have a RGBW lamp. Only the RGB value can be obtained in the code. How can the W value be obtained?

JN-AN-1218-Zigbee-3-0-Light-Bulb is the DeMeo code for this project, which provides how to get RGB values, but no White values. Which part of the code should I refer to to get the white value?

pastedImage_1.png

pastedImage_2.png

pastedImage_3.png

How to get the RGBW values?  Thankyou very much!

0 Kudos
7 Replies

695 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hello,

The RGB value for the white color it's R 255 G 255 B 255.

Hope that helps

Regards,

Estephania

0 Kudos

695 Views
yuboli
Contributor II

Thanks your replay,

But I have a RGBW lamp, which is controlled by 4-way pwm.   How to convert X, Y values to R, G, B, W values, How can I control it?

0 Kudos

695 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hello,

You will need to implement your own function in order to control and adapt the different PWM with that W value missing for you lamp.

One thing I can think of it's that you can use the RGB function that we provide just to adapt the valuesof the Red Green and Blue , and change the fourth PWM through a different function to control the W, still that will be your own implementation for your device.

Regards,
Estephania

0 Kudos

695 Views
yuboli
Contributor II

I used the RGB function you provided to adjust the values of red, green and blue. It didn't feel very good.it wasn't all green when it was green, it wasn't all blue when it was blue, it wasn't all red when it was red.

How to change the fourth PWM to control W value?

0 Kudos

695 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hello,

Sorry, it is not clear for  me what you are referring to.  Your light bulb needs 4 PWM, you already have 3 of them for the red, green and blue you need to add a fourth PWM.

You can verify in this post how to configure a new PWM in other pin, still, please make sure that you have enough pins and timers to achieve what you are looking for.

Regards,

Estephania

0 Kudos

695 Views
yuboli
Contributor II

hi,

Thank you for your reply.

I can control my color lights according to the RGB function provided by you.

But I still have some questions. Now I still have a PWM to control whilte. How should I set the whilte value, under what circumstances, the white light duty ratio is small, and under what circumstances, the white light duty ratio is large?

Do you have any code references?

0 Kudos

695 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hello,

Sorry, it is not quite clear for me what the question is.

In the post I attached in the last answer you have a complete demo function on how to use and configure the PWM, what your lamp needs in the W pin will depend on the model you are using.

The duty cycle will depend on how you configure it and what your lamp needs.

Regards,

Estephania

0 Kudos