30064 Parallax Inc, 30064 Datasheet - Page 22

STAMP PLC

30064

Manufacturer Part Number
30064
Description
STAMP PLC
Manufacturer
Parallax Inc
Datasheet

Specifications of 30064

Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
BASIC Stamp®
Module/board Type
-
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Lead free / RoHS Compliant
Other names
Q2172565
flowA
flowB
auxContactA
auxContactB
pumpAStatus
pumpBStatus
' -----[ EEPROM Data ]-----------------------------------------------------
Records
' -----[ Notes ]-----------------------------------------------------------
'
'
'
'
'
'
'
'
'
The first section of code handles the initialization. The first line, in this case, is not necessary because the
Stamp clears all variables to zero automatically. The program consists of a large loop that is executed
over, and over again. Within the main loop, the serial port is examined. If the host has sent a character,
that character is received, parsed and executed. If no characters are received within one second, or once
the received character has been parsed the monitor and control section of code is executed.
' -----[ Initialization ]--------------------------------------------------
' -----[ Main Program ]----------------------------------------------------
Main:
Parallax, Inc. • Stamp PLC (#30064) • Version 1.8 • 12/29/2003
ptr = 0
setPoint1 = 100
setPoint2 =
SERIN 16, Baud, 1000, Control_Level, [keyIn]
SELECT keyIn
CASE "A"
CASE "B"
CASE "a"
CASE "b"
CASE "D"
SEROUT 16, Baud, [CR, "Runtime A:", DEC runTimeA, CR]
SEROUT 16, Baud, [CR, "Runtime B:", DEC runTimeB, CR]
runTimeA = 0
SEROUT 16, Baud, [CR, "Runtime A cleared", CR]
runTimeB = 0
SEROUT 16, Baud, [CR, "Runtime B cleared", CR]
IF ptr > 0 THEN
SEROUT 16, Baud, [CR, "Tank Level Report", CR, CR]
FOR tmp = 0 TO (ptr-4 MIN 1) STEP 4
NEXT
READ tmp-3,keyIn
READ tmp+3,keyIn
SEROUT 16, Baud, ["Hour: ", DEC3 tmp/4,
DATA
50
VAR
VAR
VAR
VAR
VAR
VAR
0(256)
2-7
0
1
Inputs.BIT0
Inputs.BIT1
Inputs.BIT2
Inputs.BIT3
pumpStatus.LOWNIB
pumpStatus.HIGHNIB
Pump Status Definition
Start Codes defined
1
2
3
OK Off
OK On
undefined
"
PumpA desired
PumpB desired
Both pumps desired
Tank Level: ", DEC3 keyIn, CR]
' Inputs via HC165
'1 = Flow
'1 = Motor ON, 0 = Motor off
' Bit variables
' Data table for records.
' the pointer > 64, the old data will
' be overwritten by new data because
' each record = 4 bytes.
' Set record pointer to the start
' First low level setpoint
' Second low level setpoint
A-F
8
9
OK, 0 = No Flow
FAILED no flow
FAILED no aux contact
undefined
Note! when
Page
22

Related parts for 30064