4180 LabTeam - Spring '18 / Mbed 2 deprecated Lab1_Part9

Dependencies:   mbed

Fork of Lab1_Part9 by Barry Johnson-Smith

main.cpp

Committer:
bjs9
Date:
2018-01-31
Revision:
3:e09fd735ed93
Parent:
2:29ca1063cbc3
Child:
4:e4aed7bf3e21

File content as of revision 3:e09fd735ed93:

#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(2 *pi  * i/20);
        //printf("aout = %1.2f volts\n",aout.read());
        }
    }
}