3.5.Relay Output / Digit Input / Buzzer / LED Indicator
Set LED indicator ON/OFF | INT 09H |
Entry Parameters: | AH = 2 |
| Bit# 76543210 |
| AL= 0000xxxx, where: |
| x: 1, Set LED on |
| 0, Set LED off |
| Bit0: LED1 |
| Bit1: LED2 |
| Bit2: LED3 |
| Bit3: LED4 |
Returned Value: | None |
Ex. AL = 00000011 means to turn on LED1 and LED2.
void TD_LED(int led1,int led2,int led3,int led4)
{
regs.h.ah = 2; regs.h.al = 0;
if (led1 > 0) regs.h.al = regs.h.al 1; if (led2 > 0) regs.h.al = regs.h.al 2; if (led3 > 0) regs.h.al = regs.h.al 4; if (led4 > 0) regs.h.al = regs.h.al 8; int86(0x09,®s,®s);
}
Read Photo Coupler Level state INT 08H
Entry Parameters: | AH = 1 | ;Read input from port 1 | |
|
| 2 | ;Read input from port 2 |
|
| 3 | ;Read input from port 3 |
|
| 4 | ;Read input from port 4 |
| AL = | 0 | ;Read level state |
|
| 1 | ;Read edge switching state |
Returned Values: | by level |
| |
| AL = | 0 | (LOW) |
|
| 1 | (HIGH) |
Returned Values: | by edge switching state | ||
| AL = | 0 | (No switching edge) |
|
| 1 | (Switching edge occurred) |
int TD_photocouple(int port,int type)
{