oHeading Object

Main Index
Object List
Back to top of pageDescription:
 The oHeading Object manages a signed 8-Bit variable intended to be used as a URCP Heading value so that it can be used in a virtual circuit.  As well as the value of the variable, status properties are provided that can also be used in a virtual circuit.

The oHeading Object has properties and methods that support the URCP Heading value.

URCP Heading values deal with circles, trigonometry, angles and headings.  The common numbering system chosen for this is Binary-Radians (Brads) which divides a full circle (360 degrees) into 256 even parts.  256 brads per 360 degrees is used so that a single byte can represent a full circle.

Objects such as the oJoystick, oTracker, oServoX, etc. use URCP Heading values.  This allows one device such as the oTracker to read a heading from a line on the ground.  This value then can be copied to an oServoX Object to steer a robot in the direction needed to follow a line.  Similarly, the oJoystick can be used to provide the heading.

There are three main differences between this object and a standard Char variable. 

  1. This Object's Value property is an instance of the oValue Object which can be pointed to by a Virtual Circuit. 
  2. This Object maintains status bits which can be pointed to by Virtual Circuits.
  3. This Object is 1 byte larger in order to store the status information.
 The following table lists the size and availability of the oHeading Object.
 ObjectSizeDescriptionA1A2B1B2C1
oHeading2 BytesAn Object that manages a URCP heading value.xxx
Back to top of pageOperation:
 An oHeading Object variable stores a signed 8 or 16 Bit value in its Value property and maintains other values that represent the status of those 8 bits.

The Negative property indicates the Most-Significant-Bit of the value which is used to indicate when the value is a negative number.

The NonZero Property indicates if the value is not zero.

Back to top of pageProperties:

The following table lists the properties of the oHeading Object:

Property

Description

Value
The heading value.
Object Class: oValue Value Range: 0 - 255
Data Type: Numeric Default Value: 0
ValuePressed


URCP Heading

-128"South"
-64"West"
0"North"
64"East"
Negative
A value that indicates the Value property is less than zero.
Object Class: oLogic Value Range: 0 - 1
Data Type: Numeric Default Value: 0
Notes on virtual circuit usage: Not all implementations of the oHeading Object have a linkable Negative property.  While all instance of the oHeading Object that you create in your programs will have a linkable Negative property,  some of the ooPIC Objects create a custom oHeading Object instance that cannot.
NegativeDescription
0

The Value property is a Positive value.

1

The Value property is Negative Value.

NonZero
A value that indicates the Value property is more than or less than zero.
Object Class: oLogic Value Range: 0 - 1
Data Type: Numeric Default Value: 0
Notes on virtual circuit usage: Not all implementations of the oHeading Object have a linkable NonZero property.  While all instance of the oHeading Object that you create in your programs will have a linkable NonZero property,  some of the ooPIC Objects create a custom oHeading Object instance that cannot. 
NonZeroConstantDescription
0cvFalse

The Value property is zero.

1cvTrue

The Value property is not zero.

Data
The data for the Value property.
Object Class: oVar8 Value Range: 0 - 256
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 Related Items:
 The following table lists objects that use the oHeading Object.
 ObjectDescriptionA1A2B1B2C1
oBumper4Reads a 4-contact bumper.xxx
oBumper8Reads an 8-contact bumper.xx
oCompassDNReads a Dinsmore 1490 Compass.xxx
oCompassVXReads a Vector V2X Compass.xxx
oJoyStickReads an Atari style joystickxxx
oKnobReads the position of a Knob.x
oOrbitSwitch4Reads a circular array of 4 switches.xx
oOrbitSwitch8Reads a circular array of 8 switches.xx
oServoXControls an RC Servo-motor with a signed value.xxx
oTrackerAn Object that tracks the position of a line.xxx
 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oDistanceManages a URCP Distance value.xxx
oPowerManages a URCP Power value.xxx
Back to top of page Version History and Bug List:
 Firmware Ver B1: Introduced.

Bugs: No known bugs.



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