btnut/extras/teco_ssmall/tsl2550.h File Reference


Detailed Description

Sensor interface for Teco Particles SSMALL boards.

Author:
Lukas Winterhalter

#include <sys/types.h>

Functions

short tsl_calculate_lux (u_char channel0, u_char channel1)
u_char tsl_init (void)
u_char tsl_read (u_char *channel0, u_char *channel1)


Function Documentation

short tsl_calculate_lux ( u_char  channel0,
u_char  channel1 
)

Converts channel values from both sensors to an approximated value in lux.

This is a simplified lux equation approximation using lookup tables. see http://www.taosinc.com/downloads/pdf/dn9b_tsl2550_Lux_Calculation.pdf

Parameters:
channel0 
channel1 
Returns:
Brightness in lux or -1 on error
Examples:
sensor-app/senso.c.

u_char tsl_init ( void   ) 

Initialise the light sensor.

TwInit() has to be called before.

Returns:
0 on success, 1 otherwise
Examples:
sensor-app/senso.c.

u_char tsl_read ( u_char channel0,
u_char channel1 
)

Read sampled sensor data.

After this call, the sensor needs 800ms integration time, before the next values can be read.

Parameters:
channel0 (all light)
channel1 (IR-light only)
Returns:
0 on success, 1 otherwise
Examples:
sensor-app/senso.c.


Generated on Wed Apr 29 11:12:30 2009 for BTnut System Software by doxygen 1.5.1