Barry Johnson-Smith
/
Lab1_Part9
Lab1_Part9
main.cpp
- Committer:
- bjs9
- Date:
- 2018-01-31
- Revision:
- 0:a0adc5ccd394
File content as of revision 0:a0adc5ccd394:
#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); } } }