btnut/extras/teco_ssmall/micsampler.h File Reference


Detailed Description

Sensor interface for Teco Particles SSMALL boards.

Author:
Lukas Winterhalter

#include <sys/types.h>

Functions

void mic_init (void)
u_short mic_read (void)
 Reads loudest microphone value.
void mic_set_leds (u_short mic_val)
 Sets the LEDs according to mic val.


Function Documentation

void mic_init ( void   ) 

Initialize microphone sampling.

This will start a seperate low priority thread that continuously reads microphone values. The ADC is set to free running mode and samples values at 62.5kHz ( clock).

Warning:
Do not use the ADC after this function has been called!
Examples:
sensor-app/senso.c.

u_short mic_read ( void   ) 

Reads loudest microphone value.

This function returns the loudest sampled microphone value since the last time it has been called. The values range from 0 to 1023 (loudest).

Returns:
mic value
Examples:
sensor-app/senso.c.

void mic_set_leds ( u_short  mic_val  ) 

Sets the LEDs according to mic val.

silence: all LEDs off . one LEDs on . two LEDs on . three LEDs on very loud: all LEDs on

Parameters:
mic_val microphone value
Examples:
sensor-app/senso.c.


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