The oIRPD1 Object monitors the I/O line specified by the IOLine property and updates the Position property with the current state. The I/O line is expected to be connected to the output of an IR Proximity Detector.
In the following example, the oIRPD1 Object is used to read a Lynxmotion IRPD.
Visual Basic Syntax
C and Java Syntax
' This program reads a Lynxmotion
' IRPD1 and displays the
' results on I/O line 7
Dim A As New oIRPD1
Dim B As New oDIO1
Sub Main()
A.IOLine = 9
B.IOLine = 8
B.Direction = cvOutput
Do
B.Value = A.Value
Loop
End Sub
// This program reads a Lynxmotion
// IRPD1 and displays the
// results on I/O line 7
oIRPD1 A = New oIRPD1;
oDIO1 B = New oDIO1;
Void Main(Void){
A.IOLine = 9;
B.IOLine = 8;
B.Direction = cvOutput;
Do{
B.Value = A.Value;
} While (1);
}
Basic Syntax
' This program reads a Lynxmotion
' IRPD1 and displays the
' results on I/O line 7
A As oIRPD1(9)
B As oDIO1(8,cvOutput)
Do
B.Value = A.Value
Loop