Chapter 3 Control Programming
1. QUICK BASE Programming Sample
Input:
CLS
CALL OUT PORTA
,
1
OUT PORTA,1+2
SLEET(1)
OUT PORTA,0
Input:
CLS
PORTA=&H2A0
A=INP(PORTA)
PRINT A
B=INP(PORTA)AND 2
PRINT B
Clear Screen
Output & H2A0 Address’ 0 digit is with high electric level (DO0-DO7,
10000000)
Output & H2A0 Address’ 01 digit is with high electric level
(DO0-DO7, 11000000)
Pause one second
Output & H2A0 address’ all output data are with low electric levels
Clear Screen
Define input address.
‘Read&H2A0 interface 8-bit data status. (DI0-DI7)
Print A’s value to the screen.
‘Specific read & H2A0 second digit interface and data status. (DI1)
‘Print B’s value to the screen.