Skip to content

Instantly share code, notes, and snippets.

View certifiedwaif's full-sized avatar

Mark Greenaway certifiedwaif

  • University of Sydney
  • Sydney, Australia
View GitHub Profile
@donghee
donghee / sinewave.cpp
Created March 24, 2014 20:18
MBED sine wave to p18
#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;