Repository for ECE 3140 Final Project

Files at this revision

API Documentation at this revision

Comitter:
TSSherman98
Date:
Sun May 12 04:09:15 2019 +0000
Parent:
95:f191a7ee705b
Commit message:
Commit as of 05/12/2019 at 12:09 AM

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r f191a7ee705b -r 93d556043569 main.cpp
--- a/main.cpp	Sun May 12 03:35:54 2019 +0000
+++ b/main.cpp	Sun May 12 04:09:15 2019 +0000
@@ -1,4 +1,4 @@
-/* 
+/*
     ECE 3140 - Spring 2019
     Lab #6 - Final Project
     04//25/2019 - 05/17/2019
@@ -10,8 +10,6 @@
                             GLOBAL VARIABLES
  *----------------------------------------------------------------------------*/
 const double pi = 3.141592653589793238462;
-const double amplitude = 0.5f;
-const double offset = 65535/2;
 double offset = 65535/2;
 double amplitude = 65535/2;     //this controls VOLUME
 double freq = 2000.0;           //frequency in Hz --> controls TONE
@@ -29,9 +27,9 @@
     clock.start();              //counts time in microseconds
     uint16_t sample;            //voltage to be output
     led1 = !led1;               //turn on LED to indicate operation
-    
+
     while (1) {
-        sample = (uint16_t)((amplitude)*sin(2.0*pi*f*clock.read_us())+offset); 
+        sample = (uint16_t)((amplitude)*sin(2.0*pi*f*clock.read_us())+offset);
         aout.write_u16(sample);
     }
 }