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

Barometric Sensor
[HiTechnic]

Files

file  hitechnic-barometer.h
 

HiTechnic Barometric Sensor driver.


Defines

#define HTBM_I2C_ADDR   0x02
#define HTBM_OFFSET   0x42
#define HTBM_TEMP_HIGH   0x00
#define HTBM_TEMP_LOW   0x01
#define HTBM_PRES_HIGH   0x02
#define HTBM_PRES_LOW   0x03

Functions

long HTBMreadMInHg (tSensors link)
float HTBMreadhPa (tSensors link)
float HTBMreadPsi (tSensors link)
float HTBMreadTemp (tSensors link)
float HTBMreadTempF (tSensors link)

Variables

const float mInHgtohPa = 0.03386389
const float mInHgtoPsi = 0.491098/1000
tByteArray HTBM_I2CRequest
tByteArray HTBM_I2CReply

Detailed Description

HiTechnic Barometric Sensor


Define Documentation

#define HTBM_I2C_ADDR   0x02

Barometric sensor device address

Definition at line 44 of file hitechnic-barometer.h.

#define HTBM_OFFSET   0x42

Offset for data registers

Definition at line 45 of file hitechnic-barometer.h.

#define HTBM_PRES_HIGH   0x02

Pressure high byte

Definition at line 48 of file hitechnic-barometer.h.

#define HTBM_PRES_LOW   0x03

Pressure low byte

Definition at line 49 of file hitechnic-barometer.h.

#define HTBM_TEMP_HIGH   0x00

Temperature high byte

Definition at line 46 of file hitechnic-barometer.h.

#define HTBM_TEMP_LOW   0x01

Temperature low byte

Definition at line 47 of file hitechnic-barometer.h.


Function Documentation

float HTBMreadhPa ( tSensors  link )

Read the current atmospheric pressure in hecto Pascal

Parameters:
linkthe HTBM port number
Returns:
pressure in hecto Pascal, -255 if something went wrong
Examples:
hitechnic-barometer-test1.c.

Definition at line 87 of file hitechnic-barometer.h.

long HTBMreadMInHg ( tSensors  link )

Read the current atmospheric pressure in 1/1000th inch Hg (mercury)

Parameters:
linkthe HTBM port number
Returns:
pressure in 1/1000th inch Hg (mercury), -255 if something went wrong
Examples:
benedettelli-nxt2wifi-test1.c, and hitechnic-barometer-test1.c.

Definition at line 68 of file hitechnic-barometer.h.

float HTBMreadPsi ( tSensors  link )

Read the current atmospheric pressure in pounds per square inch

Parameters:
linkthe HTBM port number
Returns:
pressure in pounds per square inch, -255 if something went wrong
Examples:
hitechnic-barometer-test1.c.

Definition at line 97 of file hitechnic-barometer.h.

float HTBMreadTemp ( tSensors  link )

Read the current air temperature in degrees Celcius

Parameters:
linkthe HTBM port number
Returns:
current air temperature in degrees Celcius, -255 if something went wrong
Examples:
benedettelli-nxt2wifi-test1.c, and hitechnic-barometer-test1.c.

Definition at line 107 of file hitechnic-barometer.h.

float HTBMreadTempF ( tSensors  link )

Read the current air temperature in degrees Fahrenheit

Parameters:
linkthe HTBM port number
Returns:
the current air temperature in degrees Fahrenheit, -255 if something went wrong
Examples:
hitechnic-barometer-test1.c.

Definition at line 130 of file hitechnic-barometer.h.


Variable Documentation

Array to hold I2C reply data

Definition at line 61 of file hitechnic-barometer.h.

Array to hold I2C command data

Definition at line 60 of file hitechnic-barometer.h.

const float mInHgtohPa = 0.03386389

Definition at line 51 of file hitechnic-barometer.h.

const float mInHgtoPsi = 0.491098/1000

Definition at line 52 of file hitechnic-barometer.h.