<p>Can anyone help me with PRI ALT.</p>
<p>I am a beginner and have been trying to figure out how to use occam to build<br>
a simple cat deterrent.</p>
<p>I have the following code. It is not representative of what I want it to do<br>
eventually but rather to experiment with PRI ALT.</p>
<p>I am expecting that a signal from CatOut or CatIn should drive ArmedLED low<br>
or high. However it appears to ignore these signals. I appears always to<br>
default to final TRUE & SKIP condition. I am stuck and I don't know how to<br>
debug it. Any ideas gratefully received.</p>
<p>#INCLUDE "plumbing.module"</p>
<p>VAL OutPin IS 2 :<br>
VAL InPin IS 3 :<br>
VAL ArmedLED IS 12 :<br>
VAL SprayLED IS 13 :</p>
<p>PROC blink.pin (CHAN SIGNAL out!)<br>
WHILE TRUE<br>
SEQ<br>
delay (500)<br>
out ! SIGNAL<br>
:</p>
<p>PROC monitor.pir ()<br>
SEQ<br>
digital.mode (InPin, INPUT)<br>
digital.mode (OutPin, INPUT)<br>
digital.mode (ArmedLED, OUTPUT)<br>
digital.mode (SprayLED, OUTPUT)<br>
digital.write (ArmedLED, LOW)<br>
digital.write (SprayLED, LOW)<br>
CHAN SIGNAL CatIn, CatOut:<br>
PAR<br>
blink.pin (CatOut!)<br>
delay (300)<br>
blink.pin (CatIn!)<br>
WHILE TRUE<br>
PRI ALT<br>
CatOut ? SIGNAL<br>
digital.write (ArmedLED, LOW)<br>
CatIn ? SIGNAL<br>
digital.write (ArmedLED, HIGH)<br>
TRUE & SKIP<br>
digital.write (SprayLED, HIGH)<br>
:</p>