
emic2
Diff: emic2.h
- Revision:
- 2:32f26fe1d8ad
- Parent:
- 0:2128ea16088c
--- a/emic2.h Fri Feb 28 14:22:46 2020 +0000 +++ b/emic2.h Mon Mar 02 12:43:18 2020 +0000 @@ -1,18 +1,26 @@ #define speakf printf class emic2 : public Stream + { public : - emic2(PinName tx, PinName rx): _cmd(tx,rx) { + emic2(PinName tx, PinName rx, PinName fakers): _cmd(tx,rx) { _cmd.baud(9600); _cmd.putc('X'); //stop talking if reset and not a power on _cmd.putc('\r'); // Send a CR in case the system is already up + + DigitalIn frx(PF_1); wait(1); //delay for emic power on boot or reset respone - while (_cmd.getc() != ':'); // When the Emic 2 has initialized and is ready, it will send a single ':' - while (_cmd.readable()) _cmd.getc();//flush out buffer just in case + while (frx == 1); //00111010 + /* while (_cmd.getc() != ':'); // When the Emic 2 has initialized and is ready, it will send a single ':' + while (_cmd.readable()) _cmd.getc();//flush out buffer just in case */ }; void ready() { - while (_cmd.getc() != ':'); - while (_cmd.readable()) _cmd.getc();//flush out recieve buffer just in case + DigitalIn frx(PF_1); + while (frx == 1); + + + /* while (_cmd.getc() != ':'); + while (_cmd.readable()) _cmd.getc();//flush out recieve buffer just in case*/ }; int readable() { return _cmd.readable();