Project 7  3-Axis Accelerometer Sensor Module
Neff Site
Macros | Functions
adxl335.h File Reference

This module implements an interface for the ADXL335 accelerometer module. More...

#include "adc.h"

Go to the source code of this file.

Macros

#define ADXL335_PORT   ADC_PORT
 
#define ADXL335_ADC   ADC_MODULE
 
#define ADXL335_SCALE   48
 
#define ADXL335_OFFSET1   2616
 
#define ADXL335_OFFSET2   30000
 

Functions

uint16_t adxl335_get_x_raw (void)
 Returns the x channel output. More...
 
uint16_t adxl335_get_y_raw (void)
 Returns the y channel output. More...
 
uint16_t adxl335_get_z_raw (void)
 Returns the z channel output. More...
 
void adxl335_init (void)
 Initializes the accelerometer module. More...
 
uint16_t adxl335_get_x (void)
 Returns the X channel output. More...
 
uint16_t adxl335_get_y (void)
 Returns the Y channel output. More...
 
uint16_t adxl335_get_z (void)
 Returns the Z channel output. More...
 

Detailed Description

This module implements an interface for the ADXL335 accelerometer module.

Author
Wolfgang Neff
Version
1.1
Date
2018-07-07
History
Created: 2017-08-05
Modified: 2018-07-07

Macro Definition Documentation

◆ ADXL335_ADC

#define ADXL335_ADC   ADC_MODULE

◆ ADXL335_OFFSET1

#define ADXL335_OFFSET1   2616

◆ ADXL335_OFFSET2

#define ADXL335_OFFSET2   30000

◆ ADXL335_PORT

#define ADXL335_PORT   ADC_PORT

◆ ADXL335_SCALE

#define ADXL335_SCALE   48

Function Documentation

◆ adxl335_get_x()

uint16_t adxl335_get_x ( void  )

Returns the X channel output.

Converts the analog value of the X channel to a digital value between 0 and UINT16_MAX. It uses the formula val = scale*(res - offset1) + offset2 for the scaling.

Returns
The scaled value for the X channel.

◆ adxl335_get_x_raw()

uint16_t adxl335_get_x_raw ( void  )

Returns the x channel output.

Returns
The result of the ADC conversion

◆ adxl335_get_y()

uint16_t adxl335_get_y ( void  )

Returns the Y channel output.

Converts the analog value of the Y channel to a digital value between 0 and UINT16_MAX. It uses the formula val = scale*(res - offset1) + offset2 for the scaling.

Returns
The scaled value for the Y channel.

◆ adxl335_get_y_raw()

uint16_t adxl335_get_y_raw ( void  )

Returns the y channel output.

Returns
The result of the ADC conversion

◆ adxl335_get_z()

uint16_t adxl335_get_z ( void  )

Returns the Z channel output.

Converts the analog value of the Z channel to a digital value between 0 and UINT16_MAX. It uses the formula val = scale*(res - offset1) + offset2 for the scaling.

Returns
The scaled value for the Z channel.

◆ adxl335_get_z_raw()

uint16_t adxl335_get_z_raw ( void  )

Returns the z channel output.

Returns
The result of the ADC conversion

◆ adxl335_init()

void adxl335_init ( void  )

Initializes the accelerometer module.

Contact