This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mbed.h" | |
// Audio output demo for speaker | |
// generates a 500Hz sine wave on the analog output pin | |
// 128 data points on one sine wave cycle are precomputed, | |
// scaled, stored in an array and | |
// continuously output to the Digital to Analog convertor | |
AnalogOut DAC(p18); | |
//global variables used by interrupt routine | |
volatile int i=0; |