Arthur Semjonov
/
Serial_Communication_Slave_pub
Slave serial com
Fork of Serial_Communication_Slave by
Revision 3:7e34b54bde5a, committed 2014-02-26
- Comitter:
- ArthurSemjonov
- Date:
- Wed Feb 26 15:59:47 2014 +0000
- Parent:
- 2:b7eee254a06e
- Commit message:
- companion;
Changed in this revision
Companion.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r b7eee254a06e -r 7e34b54bde5a Companion.cpp --- a/Companion.cpp Wed Feb 19 16:16:12 2014 +0000 +++ b/Companion.cpp Wed Feb 26 15:59:47 2014 +0000 @@ -66,7 +66,7 @@ //int l = companion.receive(); for (int i=0; i<=sizeof(frequency)/sizeof(int)-1; i++) { send_note = frequency[i]; - int check = companion.receive(); + int check = companion.read(); pc.printf("\n\rCheck line = '%d'", check); if (check == 0xFF) { speaker = 0; @@ -105,8 +105,8 @@ ******************************THE DOCTOR****************************** ********************************aka master**************************** **********************************************************************/ -/*TODO: 1) Make sure while loop condition is doing what it suppose to - 2) Initialize receive note, and play it +/*TODO: + 3) Implement interrupts 4) Stopping conditions Bonus) Potentiometers for pitch and tempo @@ -129,23 +129,10 @@ wait(0.1); return; } - //pc.printf("\n\rReceived '%d'", rec_note); + if (cur != prev)playTheNote(rec_note); prev = cur; -// -// -// if (joyMID) { -// speaker = 0; //reset speaker duty cycle -// //force end condition for both master and companion -// pc.printf("\n\rInterrupted doctor song by demo"); -// wait(2); //delay for inferior humans -// return; -// } else if(joyDOWN) { -// speaker = 0; //read joyUp value. -// //force end condition due to interuppt -// pc.printf("\n\rInterrupted doctor song by Companion"); -// return; -// } + } } /*===================================================================*/