Shop OBEX P1 Docs P2 Docs Learn Events
PWMing with BS2_Functions — Parallax Forums

PWMing with BS2_Functions

NewzedNewzed Posts: 2,503
edited 2007-11-01 17:37 in Propeller 1
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
·

Comments

Sign In or Register to comment.