Sorry for the delayed response. Some comments inline.

On Mon, Apr 14, 2014 at 2:46 AM, Ronald <[email protected]> wrote:

> There is a try-catch functionality in matlab that (to me) sort of looks
> like java's try-catch. There is no generic multi-threading support in
> Matlab like there is in java as far as I know. That being said, Matlab
> always ships with a complete JRE so you can always use java's
> multi-threading. Mathworks doesn't actively advertise this fact, probably
> because they want their users to use the matlab language and matlab
> solutions (like their parallel computing toolbox e.g.) instead of java.
>
> I was also thinking about a boilerplate-like function. You could even make
> it universal for octave and matlab when you detect in which environment it
> runs. If you are interested I could make something like that e.g. a
> function that looks like this: "myioio = createIOIO('COM4');", and "myioio
> = createIOIO;" to do auto probing. Or maybe a `connectIOIO` function that
> also connects. I could also do other examples, e.g. to plot the analog
> inputs.
>
> But since I don't fully understand ioiolib and don't know how things like
> exceptions, events, connections over TCP and bluetooth should work in this
> context, I'm not sure what a proper boilerplate function should look like
> beyond a simple com-port connection.
>

That should be fairly easy to achieve. Just don't use the
"ApplicationHelper" stuff and instead write a straightforward function that
creates a IOIO instance (using IOIOFactory), then ioio.waitForConnect().
The higher level stuff that's in IOIOLib is completely optional and just
makes some Android or PC-based applications slightly simpler by creating a
thread per IOIO and doing the setup() / loop() pattern on that thread.


> Also, ideally I imagine that it would be nice when the firmware version is
> detected, and automatically the proper PC side ioiolib version is used
> (maybe even resolve and use the correct versions of the dependancies, jna
> and purejavacomm).
>

At the end of the day, you'll need to compile your app against *a* version
of IOIOLib, which needs a proper firmware to support the capabilities it is
expecting. I can have the library degrade gracefully and throw a runtime
exception when you're trying to use a feature that's not supported by the
(older) firmware. But I don't see how that would make your life happier to
get this in late runtime, whereas otherwise you'd know about it as soon as
the IOIO connects.


> Or at least give a warning when there is a mismatch.
>

There actually *is* a warning written to the log when this happens as well
as (if using the *Helper stuff) your Looper's incompatible() method will
get called instead of setup(). You can then override this method to do
whatever you want, such as popping a message box etc.


>
> That's why I thought I'd post just simple one-file example scripts that
> can easlily be adapted for other means. That way at least I don't obstruct
> other solutions by hiding or obscuring the mechanisms involved behind
> potentially ill designed abstraction layers.
>
> Op vrijdag 11 april 2014 17:50:08 UTC+2 schreef Ytai:
>>
>> Very nice! I didn't know you can do that from MATLAB. How are exceptions
>> and multi-threading handled there?
>> Also, it would be cool to wrap all the boilerplate code in a separate
>> file (function) that can be reused across apps. This function can take the
>> serial port as an argument.
>>
>>
>> On Thu, Apr 10, 2014 at 7:12 AM, Ronald <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> See attachments for examples to control the IOIO OTG using Matlab and
>>> Gnu Octave. You'll also need the jar files for purejavacomm, jna and a jar
>>> of the ioiolib.
>>> This allows me to experiment with my IOIO OTG board with an interpreted
>>> high level language without any java compilation! It may also be possible
>>> to make Simulink blocks this way.
>>>
>>> For octave, make sure you have the java package installed. I've used
>>> this version to test the script:
>>> http://sourceforge.net/projects/octave/files/Octave%
>>> 20Windows%20binaries/Octave%203.6.4%20for%20Windows%
>>> 20Microsoft%20Visual%20Studio/
>>>
>>> To whom it may concern: Thanks for creating this nice little board and
>>> it's accompanying software! I hope it will become very successful. I thing
>>> the price could come down quite a bit when production volumes increase.
>>>
>>> Kind regards,
>>>
>>> Ronald
>>>
>>>
>>>
>>>  --
>>> 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 [email protected].
>>> To post to this group, send email to [email protected].
>>>
>>> Visit this group at http://groups.google.com/group/ioio-users.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/ioio-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to