Emily Wilson / Mbed 2 deprecated ECE4180Lab1

Dependencies:   mbed MCP23S17 PinDetect USBDevice

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers part9.h Source File

part9.h

00001 #include "mbed.h"
00002 
00003 #define PI 3.14159265
00004 #define N_SAMPLES 20
00005 
00006 AnalogOut aOut(pin);
00007 
00008 int run_part9() {
00009     while (1) {
00010         for (double i = 0; i < 2*PI; i += (2*PI/N_SAMPLES) {
00011             aOut = (sin(i) * 0.5) + 0.5;
00012         }
00013     }
00014 }