Alessandro Ratti
/
Nucleo_read_hyperterminal
Bridge to test NBIoT schield
Revision 1:6d9b0810f7b8, committed 2018-01-24
- Comitter:
- aratti
- Date:
- Wed Jan 24 13:09:33 2018 +0000
- Parent:
- 0:aabe1b05abb9
- Commit message:
- to test NBIoT shield
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Jun 21 17:53:41 2017 +0000 +++ b/main.cpp Wed Jan 24 13:09:33 2018 +0000 @@ -1,18 +1,49 @@ #include "mbed.h" -Serial pc(SERIAL_TX, SERIAL_RX); +Serial pc(SERIAL_TX, SERIAL_RX,9600); DigitalOut led(LED1); +DigitalOut BG96_reset(D7); +DigitalOut VBAT_3V8_EN(D11); +//DigitalOut BG96_W_DISABLE(D11); +DigitalOut BG96_PWRKEY(D10); + +Serial BG96_uart(PA_9, PA_10,9600); int main() { + BG96_reset = 1; + VBAT_3V8_EN = 1; +// BG96_W_DISABLE = 0; + BG96_PWRKEY = 1; pc.printf("Press '1' to turn LED1 ON, '0' to turn it OFF\n"); + wait( 0.3 ); + BG96_reset = 0; + wait( 0.1 ); while(1) { - char c = pc.getc(); // Read hyperterminal - if (c == '0') { - led = 0; // OFF + char c; + + if( BG96_uart.readable() != 0 ) + { + c = BG96_uart.getc(); + // c=pc.getc(); + pc.putc(c); } - if (c == '1') { - led = 1; // ON + if( pc.readable() != 0 ) + { + //c = BG96_uart.getc(); + c=pc.getc(); +/* + if( c == '!' ) + { + BG96_reset = 1; + pc.printf("reset\n"); + wait( 0.3 ); + BG96_reset = 0; + wait( 0.1 ); + } + else +*/ BG96_uart.putc(c); + } } }
--- a/mbed.bld Wed Jun 21 17:53:41 2017 +0000 +++ b/mbed.bld Wed Jan 24 13:09:33 2018 +0000 @@ -1,1 +1,1 @@ -https://mbed.org/users/mbed_official/code/mbed/builds/0f02307a0877 \ No newline at end of file +https://mbed.org/users/mbed_official/code/mbed/builds/675da3299148 \ No newline at end of file