Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of Lab1_Part9 by
main.cpp
- Committer:
- bjs9
- Date:
- 2018-01-31
- Revision:
- 1:f21f8ffcd1b6
- Parent:
- 0:a0adc5ccd394
- Child:
- 2:29ca1063cbc3
File content as of revision 1:f21f8ffcd1b6:
#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 < 10; i++ ){
aout = sin(pi * i/10);
value = sin(pi * i/10);
//printf("aout = %1.2f volts\n",aout.read());
}
for(int i = 10; i < 20; i++ ){
aout = -1 * sin(pi * i/10);
}
}
}
