#include "p30f6014A.h"
#include "e_ad_conv.h"
#include "../../motor_led/e_epuck_ports.h"
Functions | |
| int | e_get_micro (unsigned int micro_id) |
| Get the last value of a given micro. | |
| int | e_get_micro_average (unsigned int micro_id, unsigned int filter_size) |
| Get the average on a given number of sample from a micro. | |
| int | e_get_micro_volume (unsigned int micro_id) |
| Get the difference between the highest and lowest sample. | |
| void | e_get_micro_last_values (int micro_id, int *result, unsigned samples_nb) |
| Write to a given array, the last values of one micro. | |
Variables | |
| int | e_mic_scan [3][MIC_SAMP_NB] |
| unsigned int | e_last_mic_scan_id |
The functions of this file are made to deal with the microphones data. You can simply get the current value of a given microphone. You can know the volume of noise that the e-puck is enduring. You can average the signal with a specified size.
| int e_get_micro | ( | unsigned int | micro_id | ) |
Get the last value of a given micro.
| micro_id | micro's ID (0, 1, or 2) (use MIC0_BUFFER, MIC1_BUFFER , MIC2_BUFFER defined in e_micro.h) |
| int e_get_micro_average | ( | unsigned int | micro_id, | |
| unsigned int | filter_size | |||
| ) |
Get the average on a given number of sample from a micro.
| micro_id | micro's ID (0, 1, or 2) (use MIC0_BUFFER, MIC1_BUFFER , MIC2_BUFFER defined in e_micro.h) | |
| filter_size | number of sample to average |
| void e_get_micro_last_values | ( | int | micro_id, | |
| int * | result, | |||
| unsigned | samples_nb | |||
| ) |
Write to a given array, the last values of one micro.
Write to a given array, the last values of one micro. The values are stored with the last one first, and the older one at the end of the array.
[ t ][ t-1 ][ t-2 ][ t-3 ]...[ t-(samples_nb-1) ][ t-samples_nb ]
| micro_id | micro's ID (0, 1, or 2) (use MIC0_BUFFER, MIC1_BUFFER , MIC2_BUFFER defined in e_micro.h) | |
| *result | pointer on the result array | |
| samples_nb | size of the result array (must be between 1 and MIC_SAMP_NB) |
| int e_get_micro_volume | ( | unsigned int | micro_id | ) |
Get the difference between the highest and lowest sample.
| micro_id | micro's ID (0, 1, or 2) (use MIC0_BUFFER, MIC1_BUFFER , MIC2_BUFFER defined in e_micro.h) |
| unsigned int e_last_mic_scan_id |
| int e_mic_scan[3][MIC_SAMP_NB] |
Array to store the mic values
1.5.4