PWMing with BS2_Functions
Martin, I think I've got it.· Not exactly like you said but pretty close.· I found I didn't need a new cog.· To start a color I wrote:
bs.pwm_set(blu1, 200, 8)
To turn it off I wrote:
bs.pwm_set(blu1, 0, 8)
If I wanted to creat a mixed color, say yellow, I wrote:
bs.pwm_set(red1, 150, 8)
bs.pwn_setB(grn1, 150, 8)
I also discovered that if I write:
bs.pwm_set(red1, 0, 8)
bs.pwn_setB(grn1, 0, 8)
it turns the Nichia off, no matter what color I had called previously.· I hven't quite figured that out yet.· It appears that writing 0 (duty cycle) to set or setB turns off the active pin, no matter which color it is.· I now have red, green, blue, yellow, cyan and orange.· I have one more color to go - magenta - then it will be done.· Thank you very much.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
bs.pwm_set(blu1, 200, 8)
To turn it off I wrote:
bs.pwm_set(blu1, 0, 8)
If I wanted to creat a mixed color, say yellow, I wrote:
bs.pwm_set(red1, 150, 8)
bs.pwn_setB(grn1, 150, 8)
I also discovered that if I write:
bs.pwm_set(red1, 0, 8)
bs.pwn_setB(grn1, 0, 8)
it turns the Nichia off, no matter what color I had called previously.· I hven't quite figured that out yet.· It appears that writing 0 (duty cycle) to set or setB turns off the active pin, no matter which color it is.· I now have red, green, blue, yellow, cyan and orange.· I have one more color to go - magenta - then it will be done.· Thank you very much.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
Comments
I may have had a bug in the PWM_Set functions when turning off.
Please try this updated version.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting Software
Southern Illinois University Carbondale, Electronic Systems Technologies