Shop OBEX P1 Docs P2 Docs Learn Events
Starting a new cog — Parallax Forums

Starting a new cog

NewzedNewzed Posts: 2,503
edited 2007-10-28 13:27 in Propeller 1
Graham, you are a helpful sort of chap so I am asking once again.

I have this program on my Proto Board which controls a dual Nichia RGB chip by PWMing - I use BS2_Functions.· The program works beautifully, but I can not do anything else while my main program is running.· So.....
I thought that if the PWM function, using BS2_Functions, could run on a separate cog, I could incorporate it into my piggyback program.· For instance, say I am reading the EEPROM, and that the cog has these methods:

PUB rred
· repeat
··bs.pwm(red1, 200, 1000

PUB rredstop
··bs.pwm(red1, 0 100)

When I start reading the EEPROM I want to call "rred", and when I am finished reading the EEPROM I want to call "rredstop".· Can this be done?

Now the fun part - I do not·know how to start a new cog.· Could you show me how to do this, which really means would you write the whole thing for me?· Once I have the "rred" method working, then I can add the other colors.

Thanks

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

  • deSilvadeSilva Posts: 2,967
    edited 2007-10-28 13:17
    @Newzed: This is just Graham's matter and your's - but I wonder why you do not use the resources of this forum, where you find not only dozens of examples but also discussions about pitfalls and abuse galore to learn this simple task??
  • NewzedNewzed Posts: 2,503
    edited 2007-10-28 13:27
    @deSilva, I appreciate your comment and that is normally the path I would take; however, in this particular case I was asking for Graham's help in writing a piece of code.· Once I have the code, and then I run into problems I will most certainkly use the resources of this forum, which I have done many times in the past.

    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
    ·
Sign In or Register to comment.