PDA

View Full Version : Logical Operators



CocaColaKid
- 1st May 2008, 18:22
Can PBP support more than 2 inputs for an AND command?

example:

if x=0 AND y=0 AND z=0 then DoThis

mat janssen
- 1st May 2008, 18:29
Yes PBP can do that.

mister_e
- 1st May 2008, 18:36
Yes, and make sure you add some parenthesis to make sure.


IF (X=0) AND (y<8) AND (z>4) ...

now depending where x,y,z come from, there's a few way to avoid multiple AND.

CocaColaKid
- 1st May 2008, 20:55
Ok, what I'm doing is using 2 inputs for 3 switches. One connected to portb1, another to portb.2 and the last one is connected to two diodes cathodes with there anodes connected to portb.1 and portb.2. Works fine is the parentheses. Doesn't work too good without them though.