Motor Control setEventQueueSize

12 views
Skip to first unread message

Craig Shultz

unread,
Jul 29, 2014, 5:09:57 PM7/29/14
to ioio-...@googlegroups.com
So, I've been using the motor control library for a bit now (and I think it is really kick ass), but one problem I am having with it is setting the event queue size. For some reason I can never get it to actually set and accept the new size. my setup code is basically:

sequencer_ = ioio_.openSequencer(config);
sequencer_.setEventQueueSize(40);

int numOfCues = sequencer_.available();
Log.i(TAG, "Num of Cues: " + String.valueOf(numOfCues));

sequencer_.waitEventType(Sequencer.Event.Type.STOPPED);

sequencer_.setEventQueueSize(40);

sequencer_.start();
push();
sequencer_.waitEventType(Sequencer.Event.Type.CUE_STARTED);

numOfCues = sequencer_.available();
Log.i(TAG, "Num of Cues: " + String.valueOf(numOfCues));

I attempted to set the queue size both right after I opened up the sequencer, and after it had already initialized and was in STOPPED mode. Neither of them seemed to work.

Both log statements reported back 32 as the number of available cues.

Is there something that I am missing trying to use this method?

Craig

Ytai Ben-Tsvi

unread,
Jul 31, 2014, 8:38:02 PM7/31/14
to ioio-...@googlegroups.com
The event queue is completely unrelated to the cue FIFO. The former holds events (e.g. Sequencer.Event.Type.STOPPED) sent from the IOIO to your app and the latter buffers sequencer cues. The size of the cue FIFO cannot be changed.
You can add your own software cue in front of it if you want, but if you end up doing that I'd like to know why, because I can't think of any way why you should have to.


--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Craig Shultz

unread,
Jul 31, 2014, 8:49:27 PM7/31/14
to ioio-...@googlegroups.com

I see. I must have gotten my cue/queues mixed up. Increasing the cue buffer size was what I was wanting to do.

It turns out, however, that I should be fine with the default size. I'm streaming duty cycles of a pwm at around 6kHz, and it is working out well.

Thanks for the clarity.

Craig

You received this message because you are subscribed to a topic in the Google Groups "ioio-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ioio-users/5N2fs_ajmYk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ioio-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages