This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

PWM Sequence loop

Hi,

I read in the documentation that one can loop a complex playback. The way I understood, one could load a first sequence (say seq1) and a second sequence (say seq2) and then loop the whole thing. So this should happen:

seq1->seq2->seq1->seq2->seq1->seq2....

But if I set playback_count=1 I get:

seq1->seq1->seq1.....

if I set playback_count=2 I get:

seq1->seq2->seq1->seq1->seq2->seq1.....

How should I set it up to get continuous alternation between seq1 and seq2 forever?

UPDATE: it only happens like this when the seq2 has only one element. If I add a second element to it, it works as expected with playback_count=1. Is this some kind of bug?

Thanks

Parents
  • Sorry for the late reply.

    What is the value of nrf_pwm_sequence_t.repeats? This determine how many extra times the sequence should be played (a value of '1' should give seq1->seq1->seq2->seq2->seq1->seq1...).

    I get the seq1->seq1->seq1... only if I have playback_count = 0, regardless of what value repeats are. If repeats is '1' and playback_count = 1 I get seq1->seq1->seq2->seq1->seq1->seq2...

    All other values give the correct behavior.

Reply
  • Sorry for the late reply.

    What is the value of nrf_pwm_sequence_t.repeats? This determine how many extra times the sequence should be played (a value of '1' should give seq1->seq1->seq2->seq2->seq1->seq1...).

    I get the seq1->seq1->seq1... only if I have playback_count = 0, regardless of what value repeats are. If repeats is '1' and playback_count = 1 I get seq1->seq1->seq2->seq1->seq1->seq2...

    All other values give the correct behavior.

Children
No Data
Related