oPower Object

Back to top of pageDescription:
 The oPower Object manages a signed 8-Bit variable intended to be used as a URCP power 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 oPower Object has properties and methods that support the URCP power value such as SetFullForward and Stop that can be used to control the power level.  Examples: 

URCP Power values deal with the relative power of an object.  The common number system chosen for this +127 for full power, -128 for full reverse power and 0 for no power.  This range is used so that a single byte can represent the full range of power. 

Typically the URCP Power value is used to drive motors where the power value is translated directly to a speed value.  This allows a single byte to control the forward and reverse speed capabilities of a robots movement.

Objects such as the oDCMotor use URCP Distance values.

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 oPower Object.
 ObjectSizeDescriptionA1A2B1B2C1
oPower2 BytesAn Object that manages a URCP power value.xxx
Back to top of pageOperation:
 An oPower Object variable stores a signed 8-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 oPower Object:

Property

Description

Value
The power level and polarity.
Object Class: oValue Value Range: 0 - 255
Data Type: Numeric Default Value: 0
ValueDescription
-128Full Reverse
-96 
-64Half Reverse
-32 
0off
32 
64Half Forward
96 
127Full Forward
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 oPower Object have a linkable Negative property.  While all instance of the oPower Object that you create in your programs will have a linkable Negative property,  some of the ooPIC Objects create a custom oPower 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 oPower Object have a linkable NonZero property.  While all instance of the oPower Object that you create in your programs will have a linkable NonZero property,  some of the ooPIC Objects create a custom oPower 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 pageExample:

For examples, see the oDCMotor object.

Back to top of pageRelated Items:

 The following table lists objects that use the oPower Object.
 ObjectDescriptionA1A2B1B2C1
oA2DXMeasures the level of the voltage on an input line and detects when it is below a threshold.xxx
oDCMotorControls a DC motor that is driven by an LMD18200 H-Bridge driver.xxx
oDCMotor2Controls a DC motor that is driven by an L293 H-Bridge driver.xx
oDCMotorMTControls a DC motor that is driven by a Wirz 203 Motor Driver.xx
oDCMotorWZControls a DC motor that is driven by a Mondo-Tronics H-Bridge driver.xx
oHBridgeHManages the I/O for driving an H Bridge using hardware specific I/O lines for the PWM.xxx
oServoSPControls an RC Servo modified for continuous rotation.xx
oStepperSPControls a stepper motors speedxx
 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oDistanceManages a URCP Distance value.xxx
oHeadingManages a URCP Heading value.xxx
Back to top of pageVersion History and Bug List:
 Firmware Ver B1: Introduced.

Bugs: No known bugs.


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