Pacemaker code Implementation for SFWRENG 3K04

Dependencies:   FXOS8700Q Queue mbed-rtos mbed

Fork of Pacemaker by Eric dollar

Revision:
26:3b49e8c3793f
Parent:
25:d816de7067da
Child:
28:4f36e100ccbe
--- a/interface.cpp	Thu Nov 24 04:53:30 2016 +0000
+++ b/interface.cpp	Tue Nov 29 01:15:10 2016 +0000
@@ -304,8 +304,17 @@
  
 void interface::getEgram(){
     myDataStruct = new dataStruct(myHardware);
-    while(true){
-        Thread::wait(52);
+    isEgram = true;
+    pc->printf("\nPress 1 to stop streaming egram data");
+    while(isEgram){
+        if(pc->readable()){
+            char command = pc->getc();
+            if(command == '1'){
+                isEgram = false;
+                }
+            }
+        
+        Thread::wait(40);
         myQueue = myDataStruct->getData();
         //I know below doesn't look neat, but it just will print values to the screen for now. One day we may do a graph. 
         myQueue.Get( &nTemp );
@@ -328,15 +337,10 @@
         pc->printf( "Item 9 = %d\r", nTemp );
         myQueue.Get( &nTemp );
         pc->printf( "Item 10 = %d\r", nTemp );
-        myQueue.Get( &nTemp );
-        pc->printf( "Item 11 = %d\r", nTemp );
-        myQueue.Get( &nTemp );
-        pc->printf( "Item 12 = %d\r", nTemp );
-        myQueue.Get( &nTemp );
-        pc->printf( "Item 13 = %d\r", nTemp );
     }
     delete myDataStruct;
 }
+
  
 char* interface::getInput(){
     char buffer[5];