oIRPD1 Object

Back to top of page Description:
 The oIRPD1 Object is a Hardware Object that uses one I/O line to read the reflection state of an IR LED contained within an IR Proximity Detector.

It is used to detect if an object is in front of the sensor.

 The following table lists the size and availability of the oIRPD1 Object.
 ObjectSizeDescriptionA1A2B1B2C1
oIRPD11 ByteReads a Lynxmotion IR Proximity Detector.xxxxx
Back to top of page Operation:
 

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.

Back to top of page Properties:

The following table lists the properties of the oIRPD1 Object:

Property

Description

Position
A value that indicates the position of the item the detector sees.
Object Class: oLogic Value Range: 0 - 1
Data Type: Numeric Default Value: 0
PositionDescription
0The IRPD does not see an object in front of it.
1The IRPD sees an object in front of it.
IOLine
A value that specifies which I/O Line is connected to the Detector.
Object Class: oIOLine Value Range: 0 - 31
Data Type: Numeric Default Value: 0
Some I/O Lines have special purposes.  Be sure to see oIOLine help file for details.
DIO
The I/O function object used to read the IRPD.
Object Class: oDIO1 Value Range: 0 - 1
Data Type: Numeric Default Value: 0
Address
Returns a pointer to the address of the oCounter Object instance.
Object Class: oAddress Value Range: 0 - 127
Data Type:Pointer (Read Only) Default Value: Address of Object

Back to top of page Examples:
 In the following example, the oIRPD1 Object is used to read a Lynxmotion IRPD.
Visual Basic SyntaxC 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
 
Back to top of page Connections:
Lynxmotion IRPD
PinNameDescriptionI/O NameooPIC
I/O Line
1SignalSensor OutputIOLineAny*
25VPower Voltage 5V
3GndGround Ground Gnd

Back to top of page Related Items:

 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oIRPDReads a Lynxmotion Dual IR Proximity Detector.xx
oIRRangeReads a Sharp GP2D12 IR ranging module.xxx
oTrackerAn Object that tracks the position of a line.xxx
Back to top of page Version History and Bug List:
 Firmware Ver A1: Introduced.

Bugs: No known bugs.


ooPIC Compiler Ver 6.0 (c) Copyright 1997 - 2007 Savage Innovations, LLC.