[C.CC USERS] occam-pi syntax question

Matt Jadud jadudm at gmail.com
Wed Apr 28 02:07:24 BST 2010


Hi Dennis,

On Tue, Apr 27, 2010 at 8:03 PM, Dennis Meade <meade.dennis at gmail.com> wrote:
> So, what did I do wrong? Notice, I broke broke up a calculation in the first
> FUNCTION to get it past the compiler.

>    :        ALT
>    :          degrees ? current.degrees
>    :            pulse := degrees.to.pulse ( current.degrees,
>    :            min.degrees, max.degrees, min.pulse, max.pulse )
>  53:            reset := TRUE
> -----------------^

ALT, like many occam syntaxes, may only have one process underneath
it. Because you broke up your calculation, it looks like multiple...
but it isn't.

So, you need to say:

ALT
  SEQ
    ... blah
    ... and blah
    ...

Or, if you want to do things in PARallel under the ALT, you would use that.

I tested this with your code, and that took care of the syntax error.
Nicely done, by the way.

Note... I'm not sure what kind of timing resolution you need for the
servos. Please keep us in the loop on that. You're adventuring into
new territory, which is awesome.

Cheers,
Matt




More information about the users mailing list