Barry Johnson-Smith
/
Lab1_Part9
Lab1_Part9
Revision 0:a0adc5ccd394, committed 2018-01-31
- Comitter:
- bjs9
- Date:
- Wed Jan 31 17:56:24 2018 +0000
- Commit message:
- Lab1_Part9;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jan 31 17:56:24 2018 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" +#include <math.h> + +#ifndef M_PI +#define M_PI 3.1415 +#endif + +AnalogOut aout(p18); +float value = 0.0f; + +int main() +{ + const double pi = 3.141592653589793238462; + while (1) { + for(int i= 0; i < 20; i++ ){ + aout = sin(pi * i/10); + value = sin(pi * i/10); + printf("aout = %1.2f volts\n",aout.read()); + wait(0.01); + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Jan 31 17:56:24 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/7130f322cb7e \ No newline at end of file