George Cochrane
/
ScoreCount2
Peter's version
Fork of ScoreCount by
Diff: reciever.cpp
- Revision:
- 4:7cec137649a0
- Child:
- 5:a50e02fc49cd
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/reciever.cpp Thu May 02 16:07:04 2013 +0000 @@ -0,0 +1,60 @@ +#include "mbed.h" + +char string[64]; +int p; + + +int Interrogate() +{ +Serial myserial(PTC4,PTC3); +myserial.baud(1200); +DigitalOut blueled(LED1); + + + + + + + while(1) + { + while(!myserial.readable()) + { + blueled=1; + } + + if(myserial.readable()) + { + blueled=0; + myserial.scanf("%s",string); + + + + if((strstr (string,"011")) != NULL) + { + p = 1; + } + if((strstr (string,"012")) != NULL) + { + p = 2; + } + if((strstr (string,"013")) != NULL) + { + p = 3; + } + if((strstr (string,"014")) != NULL) + { + p = 4; + } + for(int f=0;f<5;f++) + { + blueled=!blueled; + wait(0.2); + return p; + + } + + + } + + } +} \ No newline at end of file