Live LiveCode Code Event #17 - wrap-up

Kay C Lan lan.kc.macmail at gmail.com
Wed Apr 13 21:23:55 EDT 2011


Hi Claudi,

I wrote:

Basically LiveCode is EXTREMELY susceptible to timing issues and there is a
> NEED to include a 'wait' command in your LiveCode loop.
>

You responded:

My code setup is a bit different. I always try to avoid a continues loop in
> my livecode code :-) I know and set the samplerate with which the arduino
> samples and sends the sensor values.
>

and:

[my LiveCode] routine calls itself in the same rythm as the samplerate of
> the arduino. This way I keep things in sync and I can still drag the stack
> window around and have a responsive user interface, so I can click on btns
> or do other things.
>

Which I believe is confirming the the first part of my statement, that
LiveCode + Arduino is EXTREMELY susceptible to timing issues. My statement
then needs to be amended to read:

If you use a repeat loop you NEED to include a 'wait' command, if you don't
use a repeat loop you need to ENSURE the sample rate of your LiveCode
matches the sample rate of your Arduino sketch.

My guess is that when you were experiencing lack of user interface
responsiveness the cpu activity was probably up around 100%. I've discovered
that when tinkering with LiveCode + Arduino, having Activity Monitor open as
well can be very revealing.

Looking forward to your next Live LiveCode presentation.



More information about the use-livecode mailing list