e_micro.c File Reference

Accessing the microphone data. More...

#include "e_ad_conv.h"
#include "./../motor_led/e_epuck_ports.h"
#include "e_micro.h"

Functions

void e_init_micro (void)
 Init the microphone A/D converter.
void e_get_micro (int *m0, int *m1, int *m2)
 To get the m0, m1, m2 microphones's values.


Detailed Description

Accessing the microphone data.

A little exemple which takes the volume of micro1 and if the sound level is more than 2000. The LED1 is turned on.

 #include <p30f6014A.h>
 #include <motor_led/e_epuck_ports.h>
 #include <motor_led/e_init_port.h>
 #include <a_d/e_micro.h>
 
 int main(void)
 {
        int m1, m2, m3;
        e_init_port();
        e_init_micro();
        while(1)
        {
                long i;
                e_get_micro(&m1, &m2, &m3);
                if(m1 < 2000)
                        LED0 = 0;
                else
                        LED0 = 1;
                for(i=0; i<100000; i++) { asm("nop"); }
        }
 }
Author:
Code: Michael Bonani
Doc: Jonathan Besuchet

Function Documentation

void e_get_micro ( int *  m0,
int *  m1,
int *  m2 
)

To get the m0, m1, m2 microphones's values.

Parameters:
m0 A pointer to store the m0 analogic value
m1 A pointer to store the m1 analogic value
m2 A pointer to store the m2 analogic value

void e_init_micro ( void   ) 

Init the microphone A/D converter.

Warning:
Must be called before starting using microphone


Generated on Fri Feb 29 14:26:53 2008 for e-puck by  doxygen 1.5.4