oCompassDN Object

Back to top of page Description:
 A Hardware Object that reads a Dinsmore 1490 Compass and returns a URCP heading value.
 The following table lists the size and availability of the oCompassDN Object.
 ObjectSizeDescriptionA1A2B1B2C1
oCompassDN4 BytesReads a Dinsmore 1490 Compass.xxx
Back to top of page Operation:
 

The oCompassDN Object uses the 4 I/O lines specified by the IOPack to read a Dinsmore 1490 Compass module. It  converts the data to a URCP heading value which is then stored in the Heading property.

When created, the oCompassDN Object also creates an instance of the oOrbitSwitch4 object which it uses to read the 4 I/O lines and generate the Heading value.  Modifying any of the properties of the oOrbtSwitch4X Object instance will affect the oCompassDN Object's operation. See the oOrbitSwitch4 for more detail on how the 4 I/O lines are read.

Back to top of page Properties:
 

The following table lists the properties of the oCompassDN Object:

Property

Description

Heading
A value that indicates the compass heading.
Object Class: oHeading Value Range: -128 to +127
Data Type: Numeric Default Value: 0
DirectionHeading


URCP Heading

N0
NE32
E64
SE96
S-128
SW-96
W-64
NW-32
IOPack
A value that specifies which pack of 4 I/O lines is connected to the Dinsmore 1490 Compasses 4 connections..
Object Class: oIOPack Value Range: 0 - 7
Data Type: Numeric Default Value: 0
Some I/O Lines have special purposes.  Be sure to see oIOPack help file for details.
Operate
A value that selects whether or not the Dinsmore 1490 Compass is being read.
Object Class: oOperate Value Range: 0 - 1
Data Type: Numeric Default Value: 0
OperateConstantDescription
0cvOffThe compass is not read.
1cvOnThe compass is read.
DIO
The I/O function object used to read the Dinsmore 1490 Compass.
Object Class: oOrbitSwitch4 Value Range: -128 to +127
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 Examples:
 In the following example, the oCompassDN Object
' This program reads a Dinsmore 
' Compass and displays the binary 
' URCP value on I/O Lines 8 - 15

Dim A As New oCompassDN 
Dim B As New oDio8

Sub Main()
  ooPIC.Pullup = 1
  B.IOGroup = 3
  B.Direction = cvOutput
  A.IOGroup = 1
  A.Nibble = 1
  A.Operate = cvTrue
  Do
    B.Value = A.Value
  Loop
end sub
Back to top of page Connections:
 
  1. +5 Volts
  2. GND
  3. Signals:  North, East, South, West,
  • I/O 0 to North
  • I/O 1 to East or West
  • I/O 2 to South
  • I/O 3 to West or East
IOPack:1234567Coil

The Dinsmore 1490 Compass Module requires connections to 4 I/O lines.  These 4 I/O lines must be 4 contiguous I/O lines starting with I/O line 8, 12, 16, 20, 24, or 28.  Each of the 4 I/O lines will require a pull up resister.  If the I/O lines starting with 8 or 12 are selected, the internal pull up resisters can be used by setting the ooPIC.PullUp property to 1.

I/O 0:816245122028a
I/O 1:917256132129b
I/O 2:1018267142230c
I/O 3:111927-152331d

Back to top of page Related Items:

 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oCompassVXReads a Vector V2X Compass.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.