Pacemaker code Implementation for SFWRENG 3K04
Dependencies: mbed Queue mbed-rtos FXOS8700Q
Fork of Pacemaker by
SWFRENG 3K04 Project to design, develop, and document a functional pacemaker.
The project uses the Freescale K64F Microcontroller and C++ mbed library.
Diff: interface.cpp
- Revision:
- 26:3b49e8c3793f
- Parent:
- 25:d816de7067da
- Child:
- 28:4f36e100ccbe
- Child:
- 30:cc7586a259fd
diff -r d816de7067da -r 3b49e8c3793f interface.cpp --- 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];