oRCIN(1-6)X Object

Back to top of pageDescription:
 An oRCIN(1-6)X Object is a Hardware Object that reads the RC Servo Pulse Stream signal from an RC Radio Receiver.  It extracts each servo's data signal from the stream and updates values that indicate the URCP positions for each servo. Up to six channels can be parsed providing up to six servo positions.

The oRCIN(1-6)X Objects use the single digital I/O line 17 to read the pulse stream.

 The following table lists the size and availability of the oRCIN Object and its variations.
 ObjectSizeDescriptionA1A2B1B2C1
oRCIN1X7 BytesAn Object that reads a Radio Receiver with 1 channel and returns URCP values.x
oRCIN2X9 BytesAn Object that reads a Radio Receiver with 2 channels and returns URCP values.x
oRCIN3X11 BytesAn Object that reads a Radio Receiver with 3 channels and returns URCP values.x
oRCIN4X13 BytesAn Object that reads a Radio Receiver with 4 channels and returns URCP values.x
oRCIN5X15 BytesAn Object that reads a Radio Receiver with 5 channels and returns URCP values.x
oRCIN6X17 BytesAn Object that reads a Radio Receiver with 6 channels and returns URCP values.x
Back to top of pageOperation:
 The oRCIN(1-6)X Objects monitor I/O Line 17 and looks for the signals provided by a Radio Receiver. 

The Operate property specifies if the receiver is being read.

The Ch1 through Ch6 properties are updated with the servo positioning information read from the Radio Receiver.  Channel 1 data will update the Ch1 property, Channel 2 will update Ch2, and so on until up to 6 channels are read.  If an oRCIN object with fewer channels than the radio receiver has is used, then only the channels represented in the oRCIN object will be read.  The position value matches the positioning values used by the oServoX Object where 0 is considered the center position for the servo.

The Adjust property adjusts the servo positions in 2.8 degree steps.  Adjust is a value with a range of 0 to 7 and defaults to 3, so the positions can be adjusted down 8.4 degrees and up 11.2 degrees.

The DIO property is an instance of the oPulseTimeH object which is created when the oRCIN(1-6)X object is.  The oRCIN(1-6)X object configures the oPulseTimeH object in such a way that it will read the servo pulse stream provided by the radio receiver.  Attributes of the oPulseTimeH operation can be adjusted by directly manipulated. but note that doing so may change the way the oRCINX object behaves to something different than the way described in this document.  (see oPulseTimeH object for more detail)

The maximum number of oRCIN(1-6)X objects that can be dimensioned in a single application program is 1.

Back to top of pageProperties:
 

The following table lists the properties of the oRCIN Object:

Property

Description

Operate
A value that selects if the RC Receiver is being read.
Object Class: oOperate Value Range: 0 - 1
Data Type: Numeric Default Value: 0
OperateConstantDescription
0cvOffThe RC Receiver is not being read.
1cvOnThe RC Receiver is being read.
Adjust
A value that specifies an adjustment for the servo positions.
Object Class: oVar3 Value Range: 0 - 7
Data Type: Numeric Default Value: 3
Ch1
Channel 1 servo position.
Object Class: oHeading Value Range: -64 to 63
Data Type: Numeric Default Value: 0
Ch2
Channel 2 servo position.
Object Class: oHeading Value Range: -64 to 63
Data Type: Numeric Default Value: 0
Ch3
Channel 3 servo position.
Object Class: oHeading Value Range: -64 to 63
Data Type: Numeric Default Value: 0
Ch4
Channel 4 servo position.
Object Class: oHeading Value Range: -64 to 63
Data Type: Numeric Default Value: 0
Ch5
Channel 5 servo position.
Object Class: oHeading Value Range: -64 to 63
Data Type: Numeric Default Value: 0
Ch6
Channel 6 servo position.
Object Class: oHeading Value Range: -64 to 63
Data Type: Numeric Default Value: 0
DIO
The I/O function object used to control the servo.
Object Class: oPulseTimeH Value Range: 0 - 65535
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 pageExample:
 In the following examples, the oRCIN3 is used.
Visual Basic Syntax C and Java Syntax
' This program reads an RC radio
' and sets servos based on the
' positions for channel 1 and 6.

Dim V As New oRCIN6X
Dim S1 As New oServoX
Dim S2 As New oServoX

Sub main()
  V.Operate = 1
  S1.IOLine = 7
  S1.Operate = cvOn
  S2.IOLine = 6
  S2.Operate = cvOn
  Do
    S1.Position = V.Ch1
    S2.Position = V.Ch6
  Loop 
End Sub
' This program reads an RC radio
' and sets servos based on the
' positions for channel 1 and 6.

oRCIN6X V = New oRCIN6X;
oServoX S1 = New oServoX;
oServoX S2 = New oServoX;

Void main(Void){
  V.Operate = 1;
  S1.IOLine = 7;
  S1.Operate = cvOn;
  S2.IOLine = 6;
  S2.Operate = cvOn;
  Do{
    S1.Position = V.Ch1;
    S2.Position = V.Ch6;
  } While(1); 
}
Basic Syntax 
' This program reads an RC radio
' and sets servos based on the
' positions for channel 1 and 6.

V As oRCIN6X(3,1)
S1 As oServoX(7,,,,,,,cvOn)
S2 As oServoX(6,,,,,,,cvOn)

Do
  S1.Position = V.Ch1
  S2.Position = V.Ch6
Loop 
 

Back to top of pageRelated Items:

 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oRCIN(1-6)An Object that reads a Radio Receiver with up to 6 channels.x
oServoXControls an RC Servo-motor with a signed value.xxx
Back to top of pageVersion History and Bug List:
 Firmware Ver C1: Introduced.

Bugs: No known bugs.


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