A simple sawtooth waveform generator using analog output.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:95fd5a7168ac
- Child:
- 1:8901d4a806a8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Dec 17 16:19:30 2014 +0000 @@ -0,0 +1,12 @@ +#include "mbed.h" + +AnalogOut out(p18); + +int main() { + while(1) { + for (int i = 0; i < 10; i++) { + out = i / 10; + wait_ms(1); + } + } +} \ No newline at end of file