Mindstorms 3rd Party ROBOTC Drivers RobotC
[Home] [Download] [Submit a bug/suggestion] [ROBOTC Forums] [Blog] [Support this project]
Files | Defines | Functions | Variables

Angle Sensor
[Mindsensors]

Files

file  mindsensors-angle.h
 

Mindsensors Angle Sensor driver.


Defines

#define MSANG_I2C_ADDR   0x30
#define MSANG_CMD_REG   0x41
#define MSANG_OFFSET   0x42
#define MSANG_ANG   0x00
#define MSANG_RAW   0x04
#define MSANG_RPM   0x08
#define MSANG_CMD_RST_ANG   0x72

Functions

int MSANGreadAngle (tSensors link)
int MSANGreadRPM (tSensors link)
int MSANGreadRaw (tSensors link)
bool MSANGresetAngle (tSensors link)

Variables

tByteArray MSANG_I2CRequest
tByteArray MSANG_I2CReply

Detailed Description

GlideWheel-AS Angle Sensor


Define Documentation

#define MSANG_ANG   0x00

Current angle

Definition at line 46 of file mindsensors-angle.h.

#define MSANG_CMD_REG   0x41

Command register

Definition at line 42 of file mindsensors-angle.h.

#define MSANG_CMD_RST_ANG   0x72

Resets 0 position to current shaft angle

Definition at line 51 of file mindsensors-angle.h.

#define MSANG_I2C_ADDR   0x30

HTCS2 I2C device address

Definition at line 41 of file mindsensors-angle.h.

#define MSANG_OFFSET   0x42

Offset for data registers

Definition at line 43 of file mindsensors-angle.h.

#define MSANG_RAW   0x04

Current sensor raw value (0.5 deg accuracy)

Definition at line 47 of file mindsensors-angle.h.

#define MSANG_RPM   0x08

rpms

Definition at line 48 of file mindsensors-angle.h.


Function Documentation

int MSANGreadAngle ( tSensors  link )

Return the current angle

Parameters:
linkthe MSANG port number
Returns:
current angle or -1 if an error occurred.
Examples:
mindsensors-angle-test1.c, and mindsensors-sensormux-test1.c.

Definition at line 67 of file mindsensors-angle.h.

int MSANGreadRaw ( tSensors  link )

Return the current raw sensor value

Parameters:
linkthe MSANG port number
Returns:
current raw value or -1 if an error occurred.
Examples:
mindsensors-angle-test1.c.

Definition at line 86 of file mindsensors-angle.h.

int MSANGreadRPM ( tSensors  link )

Return the rpm that the shaft is currently rotating at

Parameters:
linkthe MSANG port number
Returns:
the current rpm of the shaft or -1 if an error occurred.
Examples:
mindsensors-angle-test1.c.

Definition at line 105 of file mindsensors-angle.h.

bool MSANGresetAngle ( tSensors  link )

Reset the 0 position to the current shaft angle.

Parameters:
linkthe MSANG port number
Returns:
true if no error occured, false if it did
Examples:
mindsensors-angle-test1.c.

Definition at line 124 of file mindsensors-angle.h.


Variable Documentation

Array to hold I2C reply data

Definition at line 59 of file mindsensors-angle.h.

Array to hold I2C command data

Definition at line 58 of file mindsensors-angle.h.