[C.CC USERS] Occam-Pi programing question
Bryant Nelson
bryant.p.nelson at gmail.com
Mon Sep 3 21:24:12 BST 2012
Here is what I got so far. The problem is, all the pumps turn on at the
same time, run for the proper amount of time, then wait for the maximum
wait time. For example, the pump on pin 12 is governing the off time. After
4s all the pumps kick on, 13 is on for 1s, 12 for 2s and 11 for .7s, once
12 is done it waits 4s then everything starts at the same time.
Can somebody help me out?
#INCLUDE "plumbing.module"
PROC do (VAL INT pin, VAL INT timeOn, VAL INT timeOff)
SEQ
digital.mode (pin, OUTPUT)
digital.write (pin, HIGH)
delay(timeOn)
digital.mode (pin, OUTPUT)
digital.write(pin, LOW)
delay(timeOff)
:
PROC main ()
WHILE TRUE
PAR
do(13, 1000, 2000)
do(12, 2000, 4000)
do(11, 700, 1500)
:
On Thu, Aug 30, 2012 at 6:27 PM, Matt Jadud <matt at jadud.com> wrote:
> On Thu, Aug 30, 2012 at 6:23 PM, Matt Jadud <matt at jadud.com> wrote:
> > Hi Bryant,
>
> Two more answers to your question:
>
> http://rockalypse.org/courses/cs220f11/guides/introducing-occam-pi/
>
> That page should be migrated to concurrency.cc. I'll do that someday,
> honest. It includes linkes to a wide variety of resources, including
> some books (from back in the day) on occam, all of which are (almost
> 100%) relevant.
>
> Also, linked from that page:
>
> http://www.rockalypse.org/courses/cs220f11/resources/occamdoc/
>
> That is a (mostly accurate) set of documentation regarding the
> plumbing libraries. To turn individual (digital) pins on and off, use
>
> digital.write(pin, level)
>
> or, as an example:
>
> -- Turns on pin 13
> SEQ
> digital.mode (13, OUTPUT)
> digital.write (13, HIGH)
>
> See
>
> http://www.rockalypse.org/courses/cs220f11/resources/occamdoc/digital.html
>
> for the digital module. If that is wrong in any way, please do let us know.
>
> Cheers,
> Matt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.concurrency.cc/pipermail/users/attachments/20120903/65b6f83a/attachment.htm>
More information about the users
mailing list