A simple sawtooth waveform generator using analog output.

Dependencies:   mbed

main.cpp

Committer:
tbjazic
Date:
2014-12-18
Revision:
1:8901d4a806a8
Parent:
0:95fd5a7168ac

File content as of revision 1:8901d4a806a8:

#include "mbed.h"

AnalogOut out(p18);

int main() {
    while(1) {
        for (int i = 0; i < 10; i++) {
            out = (float) i / 10;
            wait_ms(1);
        }
    }
}