122-28176 Parallax Inc, 122-28176 Datasheet - Page 117

GUIDE STUDENT PROCESS CONTROL

122-28176

Manufacturer Part Number
122-28176
Description
GUIDE STUDENT PROCESS CONTROL
Manufacturer
Parallax Inc
Datasheets

Specifications of 122-28176

Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
Propeller Education (PE) Kit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
The count would only occur when both conditions are true.
no box present AND the flag needs to be set for a count. That "AND" is called Boolean
Logic and the BASIC Stamp supports it directly by use of an
When using an
to be true. Another operator is
entire statement to be considered true. As many operators can be used as needed to
qualify a statement. Finally
be true, but not both. Table 4-2 is a truth table for the logical operators:
The final program will have a bit more code in the condition to control the diverter, but
the principle is the same. Other than that section, the code is pretty straightforward and
the full flowchart is not shown.
' -----[ Title ]-----------------------------------------------------------
' Process Control - BoxConveyor.bs2
' Control System for conveyor belt control and box counting
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ Declarations ]----------------------------------------------------
Stop_SW
Start_SW
Opto_SW
Diverter
Box_Det
Condition A
FALSE
FALSE
TRUE
TRUE
IF (Opto_Sw = 1) AND (Edge_Flag = 1) THEN
ENDIF
Enter, save and run BoxConveyor.bs2.
Box_Count = Box_Count + 1
Edge_Flag = 0
AND
PIN
PIN
PIN
PIN
PIN
operator, both (or all) conditions must be true for the entire statement
Condition B
Table 4-2: Boolean Operator Truth Table
FALSE
FALSE
TRUE
TRUE
1
2
8
9
10
XOR
OR
, or Exclusive-OR, means one or the other condition can
, where either (or any) condition must be true for the
' PB1
' PB2
' Opto-Reflective switch
' Green LED
' Yellow LED
A AND B
FALSE
FALSE
FALSE
TRUE
A OR B
FALSE
TRUE
TRUE
TRUE
Opto_Sw
needs to indicate
AND
A XOR B
FALSE
FALSE
TRUE
TRUE
operator:

Related parts for 122-28176