Live LiveCode Code Event #17 - wrap-up

stephen barncard stephenREVOLUTION2 at barncard.com
Wed Apr 13 21:36:56 EDT 2011


Let us remember that Serial port and handshaking stuff is tricky and a black
art to make work perfectly in any situation, but especially at rates higher
than 2400 baud. We are so used to the speedy, asynchronous world of TCP
packets that interfacing with  this archaic method can be quite frustrating.
I'm not sure it's Livecode's fault. Serial interfacing has always been this
way.

I cannot remember a single time in my last 32 years when interfacing
computers and serial hasn't been some kind of struggle, requiring rewiring
cables and timing loops to make it work right. Especially troublesome over
runs longer than 10ft, unless you balance it 422 style.

On 13 April 2011 18:23, Kay C Lan <lan.kc.macmail at gmail.com> wrote:

> 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.
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 



Stephen Barncard
San Francisco Ca. USA

more about sqb  <http://www.google.com/profiles/sbarncar>



More information about the use-livecode mailing list