[C.CC USERS] Led Chase Code

amrphoto1@gmail.com amrphoto1 at gmail.com
Sun Jun 13 17:59:38 BST 2010


Got it. Will look at ALT and upload the datasheet to a safe site. Oops. 

Aaron M. Ryan

----- Reply message -----
From: "Matt Jadud" <jadudm at gmail.com>
Date: Sun, Jun 13, 2010 9:04 am
Subject: Led Chase Code
To: "Aaron Ryan" <amrphoto1 at gmail.com>
Cc: <users at concurrency.cc>


On Sun, Jun 13, 2010 at 11:56 AM, Aaron Ryan <amrphoto1 at gmail.com> wrote:
> So I may have to split them into separate processes and/or find a way to
> concurrently listen for button.press (trivial with PAR) and
> then interrupt whatever fade processes are running in order to stop them and
> reset them.

Actually, I suspect you want an ALT.

PROC foo (CHAN SIGNAL s1?, s2?, s3?)
  ALT
    s1 ? SIGNAL
      ... do one thing ...
    s2 ? SIGNAL
       ... do something else ...
    s3 ? SIGNAL
      ... yet one other possibility ...
:

This proc hits the ALT and waits. When any one of the three channels
s1, s2, or s3 becomes read, the ALT executes the code under the guard
that "fired." You might think of it as a parallel-IF over channel
communications: the ALT simultaneously watches all the channels, and
whichever becomes ready first, executes.

The ALT exits immediately after handling any one communication. So, if
you want to keep watching all of the channels, you need to put the ALT
in a loop.

> I will upload the datasheet for the SHT1x into a new directory on the SVN

Ah. Ideally, don't upload random things into the Subversion repository
-- specifically, things you don't have permission to upload. We don't
have the rights to re-distribute things like that. That is, the
datasheet is not a GPL'd document, so committing it to the repository
would thus be adding a copyrighted blob into our tree. We'd have to
filter it out.

If you want to share it, perhaps upload it to drop.io, and send a URL
to the list?

Cheers,
M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.concurrency.cc/pipermail/users/attachments/20100613/237ae5d6/attachment.htm>


More information about the users mailing list