Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 9 months ago. This question has been closed. Reason: N/A
NXP LPC 1768
I'm working on mbed pin Pwmout for Mic output. I need an output of 1 or 1.2 kHz from mbed going to the low pass filter and voltage divider. After passing through the filter and voltage divider, I need an output of 1 kHz frequency and minimum voltage of 1.65 V.
Below is the code that I have written but I can not figure out problem. Any help would be appreciable.
- include "mbed.h"
PwmOut micAudioOut(p24);
float pwmAudioOut = 1;
int main() { micAudioOut.period_ms(1); Period set to 1ms = 1kHz
while(1) {
for (float i = 0; i <= 1.0; i = i + 0.2){
pwmAudioOut = pwmAudioOut + i; wait(0.2);
} } }
Hi Chris I appreciate your post. Yes, audible tone is coming from the speaker.
posted by Ravneet S 04 Feb 2014