Elisa3
accelerometer - Copia.h File Reference

Accelerometer module. More...

#include <stdlib.h>
#include <math.h>
#include "variables.h"
#include "twimaster.h"

Go to the source code of this file.

Defines

#define ACCELEROMETER_H

Functions

void initAccelerometer ()
 Test which device is mounted on the robot and configure it.
unsigned char initADXL345 ()
 Configure the ADXL345 accelerometer (2g sensitivity, 10 bits resolution).
unsigned char initMMA7455L ()
 Configure the MMA74565L accelerometer (2g sensitivity, 10 bits resolution).
void readAccelXY ()
void readAccelXYZ ()
void computeAngle ()

Detailed Description

Accelerometer module.

Author:
Stefano Morgani <stefano@gctronic.com>
Version:
1.0
Date:
01.02.12

The I2C communication is initialized to work with the accelerometer. There are functions to work with both the Freescale MMA7455 and the Analog Device ADXL345 accelerometers.


Define Documentation

#define ACCELEROMETER_H

Function Documentation

void computeAngle ( )

Test which device is mounted on the robot and configure it.

Returns:
none
unsigned char initADXL345 ( )

Configure the ADXL345 accelerometer (2g sensitivity, 10 bits resolution).

Returns:
1 in case of errors, 0 otherwise.
unsigned char initMMA7455L ( )

Configure the MMA74565L accelerometer (2g sensitivity, 10 bits resolution).

Returns:
1 in case of errors, 0 otherwise.
void readAccelXY ( )
void readAccelXYZ ( )
 All Data Structures Files Functions Variables Typedefs Defines