I was trying to read value from the MX3's microphone. When I'm using the fonction MIC_value() from the library mic.h, I only get value around 512. What is the unit of the value that I receive from this function ? Is it the amplitude of the signal ? Also, in the user guide, they said that if we change the potentiometer, it doesn't change the value that we read at all. I don't understand why.
/*
* File: main.c
* Author: gout2401
*
* Created on 28 juin 2019, 09:47
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/attribs.h> // include in timer
#include <xc.h> // include in config_bits
#include <time.h> // librairie de base
#include <string.h>
#include "lcd.h"
#include "config.h"
#include "horloge.h"
#include "uart.h"
unsigned short *buffer;
int cntBuf1 = 5;
int ind;
unsigned int value;
char value_aff[5];
Question
MiguelD14
Hello,
I was trying to read value from the MX3's microphone. When I'm using the fonction MIC_value() from the library mic.h, I only get value around 512. What is the unit of the value that I receive from this function ? Is it the amplitude of the signal ? Also, in the user guide, they said that if we change the potentiometer, it doesn't change the value that we read at all. I don't understand why.
/*
* File: main.c
* Author: gout2401
*
* Created on 28 juin 2019, 09:47
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/attribs.h> // include in timer
#include <xc.h> // include in config_bits
#include <time.h> // librairie de base
#include <string.h>
#include "lcd.h"
#include "config.h"
#include "horloge.h"
#include "uart.h"
unsigned short *buffer;
int cntBuf1 = 5;
int ind;
unsigned int value;
char value_aff[5];
void main() {
ind = 0;
LCD_Init();
AUDIO_Init(2);
MIC_Init();
while(ind < 10000){
value = MIC_Val();
sprintf(value_aff,"%d", value);
LCD_WriteStringAtPos(value_aff, 0, 0);
ind = ind + 1;
DelayAprox10Us(10000);
}
LCD_DisplayClear();
AUDIO_Close();
DelayAprox10Us(10);
}
thanks
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.