An example program driving the AnalogOut. Connect a pair of earphones!

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 AnalogOut Aout(p18);
00004 AnalogIn pot1(p19);
00005 
00006 int main()
00007 {
00008     while(1) {
00009         for(float i=0.0; i<1.0; i+=0.1) {
00010             Aout = i;
00011             wait(0.00001+(0.0001*pot1.read()));
00012         }
00013     }
00014 }