A simple sawtooth waveform generator using analog output.

Dependencies:   mbed

Revision:
1:8901d4a806a8
Parent:
0:95fd5a7168ac
--- a/main.cpp	Wed Dec 17 16:19:30 2014 +0000
+++ b/main.cpp	Thu Dec 18 07:34:06 2014 +0000
@@ -5,7 +5,7 @@
 int main() {
     while(1) {
         for (int i = 0; i < 10; i++) {
-            out = i / 10;
+            out = (float) i / 10;
             wait_ms(1);
         }
     }