4180 lab 1
Dependencies: mbed MCP23S17 PinDetect USBDevice
part9.h
- Committer:
- emilywilson
- Date:
- 2020-01-22
- Revision:
- 12:cc5bda248946
- Parent:
- 9:be04caf5f990
File content as of revision 12:cc5bda248946:
#include "mbed.h"
#define PI 3.14159265
#define N_SAMPLES 20
AnalogOut aOut(pin);
int run_part9() {
while (1) {
for (double i = 0; i < 2*PI; i += (2*PI/N_SAMPLES) {
aOut = (sin(i) * 0.5) + 0.5;
}
}
}