A simple sawtooth waveform generator using analog output.

Dependencies:   mbed

Committer:
tbjazic
Date:
Wed Dec 17 16:19:30 2014 +0000
Revision:
0:95fd5a7168ac
Child:
1:8901d4a806a8
Initial commit.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tbjazic 0:95fd5a7168ac 1 #include "mbed.h"
tbjazic 0:95fd5a7168ac 2
tbjazic 0:95fd5a7168ac 3 AnalogOut out(p18);
tbjazic 0:95fd5a7168ac 4
tbjazic 0:95fd5a7168ac 5 int main() {
tbjazic 0:95fd5a7168ac 6 while(1) {
tbjazic 0:95fd5a7168ac 7 for (int i = 0; i < 10; i++) {
tbjazic 0:95fd5a7168ac 8 out = i / 10;
tbjazic 0:95fd5a7168ac 9 wait_ms(1);
tbjazic 0:95fd5a7168ac 10 }
tbjazic 0:95fd5a7168ac 11 }
tbjazic 0:95fd5a7168ac 12 }