oRCIN(1-6) Object

Back to top of pageDescription:
 An oRCIN(1-6) 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 a value that indicates the position for that particular servo. Up to six channels can be parsed providing up to six servo positions.

The oRCIN(1-6) 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
oRCIN17 BytesAn Object that reads a Radio Receiver with 1 channel.x
oRCIN29 BytesAn Object that reads a Radio Receiver with 2 channels.x
oRCIN311 BytesAn Object that reads a Radio Receiver with 3 channels.x
oRCIN413 BytesAn Object that reads a Radio Receiver with 4 channels.x
oRCIN515 BytesAn Object that reads a Radio Receiver with 5 channels.x
oRCIN617 BytesAn Object that reads a Radio Receiver with 6 channels.x
Back to top of pageOperation:
 The oRCIN(1-6) 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 oServo Object where 32 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) object is.  The oRCIN(1-6) 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 oRCIN 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) 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: oByte Value Range: 0 - 63
Data Type: Numeric Default Value: 0
Ch2
Channel 2 servo position.
Object Class: oByte Value Range: 0 - 63
Data Type: Numeric Default Value: 0
Ch3
Channel 3 servo position.
Object Class: oByte Value Range: 0 - 63
Data Type: Numeric Default Value: 0
Ch4
Channel 4 servo position.
Object Class: oByte Value Range: 0 - 63
Data Type: Numeric Default Value: 0
Ch5
Channel 5 servo position.
Object Class: oByte Value Range: 0 - 63
Data Type: Numeric Default Value: 0
Ch6
Channel 6 servo position.
Object Class: oByte Value Range: 0 - 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 2.

Dim V As New oRCIN3
Dim D As New o7Seg2

Sub main()
  V.Operate = 1
  D.IOGroup = 3
  D.IOLineD = 16
  D.Operate = 1
  Do
    D.Ones.Value = V.Ch2 / 4 - 2
    D.Tens.Value = V.Ch3 / 4 - 2
  Loop
End Sub
// This program reads an RC radio
// and sets servos based on the
// positions for channel 1 and 2.

oRCIN3 V = New oRCIN3;
o7Seg2 D = New o7Seg2;

Void main(Void){
  V.Operate = 1;
  D.IOGroup = 3;
  D.IOLineD = 16;
  D.Operate = 1;
  Do{
    D.Ones.Value = V.Ch2 / 4 - 2;
    D.Tens.Value = V.Ch3 / 4 - 2;
  } While (1);
}
Basic Syntax 
' This program reads an RC radio
' and sets servos based on the
' positions for channel 1 and 2.

V As oRCIN3(3,1)
D As o7Seg2(3,16,0,0,cvOn)

Do
  D.Ones.Value = V.Ch2 / 4 - 2
  D.Tens.Value = V.Ch3 / 4 - 2
Loop
 

Back to top of pageRelated Items:

 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oRCIN(1-6)XAn Object that reads a Radio Receiver with up to 6 channels using URCP values.x
oServoControls an RC Servo-motor.xxxxx
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.