oDIO1 Object
An Object that provides a 1 bit digital I/O.
Description:
  A Hardware Object that consists of one of the OOPic's I/O Lines.
Operation:
  An oDio1 Object's Value property represents the electrical state of the I/O line specified by the IOLine property. The Direction property specifies if the I/O Line is an input or an output.

When the IOLine property is set, the Direction property is updated to reflect the current state of the specified I/O Line.
NOTE: This means that you MUST set the IOLine property before you set the Direction property for the Direction property to affect the I/O line you want to use.

When the Direction property is set to 0 (cvOutput), the electrical state of the I/O line is set to the Value property once each Object List Loop.

When the Direction property is set to 1 (cvInput), the electrical state of the I/O line is used to set the Value property once each Object List Loop.

Remarks:
  Thirty-one physical 1-bit I/O Lines are implemented within the OOPic.

Caution: I/O lines 16 through 23 are used for special purposes.  Be sure that you are not using any of these I/O lines if these special functions are in use.

Storage size & Availability:
 

The following table lists the size and availability of the oDio1 Object:

ObjectSizeVersion
oDio1 1 Bytes A.1.0 and greater
Properties:
  The following table lists the Properties of the oDIO1 Object:
Property Description
Address Returns a pointer to the address of the oDIO1 Object instance.

Data-Type: Number-Pointer, Read-Only

Data-Range: 0 - 127

Direction Determines if the I/O Line is an input or an output.

Data-Type: Bit

Data-Range: 0 - 1

Default Value: 1 (cvInput)

The following table list the values of the Direction Property:

Direction Constant Description
0 cvOutput The specified I/O Line is an output and the Value property is written to it.
1 cvInput The specified I/O Line is High-Z and the Value property is read from it.
IOLine The physical I/O Line to use.

Data-Type: Byte

Data-Range: 0 - 31

The following table list the values of the IOLine Property:

IOLine Constant Description
0 cvOff The instance of the oDio1 Object is inactive and the processing time is freed for other Objects.
1 - 31   The oDio1 Object uses the pin specified for its I/O
NonZero Set to 1 when the Value property is 1 and cleared to 0 when the Value property is 0. 
Note: This property is a mirror of the Value property and is provided for code consistency.

Data-Type: Bit, Flag

Data-Range: 0 - 1

The following table list the values of the NonZero Property.

NonZero Constant Description
0 cvFalse The Value property is zero.
1 cvTrue The Value property is not zero.
String The Value property represented as a string.

Note: The String property is available in OOPic Basic Version 2

Data-Type: String Flag

Value The electrical connection to the I/O Line.

Data-Type: Bit Flag Default

Data-Range: 0 - 1

The following table lists the values of the Value Property:

Value Constant Description
0 cvOff The specified I/O line is at 0 Volts.
0 (Logic) cvLow The specified I/O line is at 0 Volts.
0 (Voltage) cvPressed A Switch connected to theoDio1 Object instance is pressed connecting the I/O line to ground.
1 cvOn The specified I/O line is at +5 Volts.
1 (Logic) cvHigh The specified I/O line is at +5 Volts.
1 (Voltage) cvUnpressed A Switch connected to theoDio1 Object instance is not pressed leaving the I/O line at +5 Volts.
Methods:
  The following table lists the Methods of the oDIO1 Object:
Methods Description
Clear Clears the Value property to 0.
Invert Inverts the bits in the Value property
Set Sets the Value property to 1.
Example:
  In the following example, the oDio1 Object is used.
'This program turns an output on and 
'then off at a rate of once a second.

Dim A As New oDio1

Sub Main()
  A.IOLine = 31
  A.Direction = cvOutput
  Do
    A.Invert
    OOPic.Delay = 100
  Loop
End Sub
See Also:
 

oDio4 - An Object that provides a 4-bit digital I/O.
oDio8 - An Object that provides an 8-bit digital I/O.
oDio16 - An Object that provides a 16-bit digital I/O.