Ver.1.30
PO-32L(PC)V
4
Example
Program that makes LED connected to O00 output terminal
as an example of use of this board. According to ON/OFF of
the external switch connected to I00 input terminal turn on
switch off is shown below. Description language is Microsoft
C. In the state of switch-on, 1 is displayed on screen, LED
lights up, 0 is displayed on screen in the state of switch-off,
and LED puts out the light.
Setting Conditions
I/O Address: 0300H
Interrupt: unused (Please remove all the short connectors of
JP1.)
Connection example
+
-
O
0
0
(
C
N
1
:
2
p
i
n
)
t
r
o
P
External
Power supply
D
C
1
2
~
2
4
V
L
E
D
5
.
1
k
O
Positive common
(
C
N
1
:
1
8
p
i
n
)
Negative common
(
C
N
1
:
1
p
i
n
)
Program List
#include<stdio.h>
void main (void)
{
int port ;
int pidata ;
port = 0x300 ; /*Set I/O Address*/
do {
pidata = inp ( port ) ; /*Input data*/
printf( "%x\n", pidata ); /*Display data*/
outp( port, pidata ) /*Output data*/
}while( !kbhit() ) ;
}
Start
Set I/O Address
Output Data
Output Data
Bit Setting Of
Output Data
Bit Setting Of
Output Data
Flow Chat