Code based on the emcu example, for more info under the first example see here: http://www.emcu.it/NUCLEOevaBoards/U2andL152/U2andL152.html

Dependencies:   mbed-src mbed

Fork of NucleoL152RE_two_boards_connected_via_USART2 by Enrico Marinoni

Revision:
3:ffd85399bece
Parent:
2:7ddee354bdfa
--- a/main.cpp	Fri Jun 27 22:56:14 2014 +0000
+++ b/main.cpp	Fri Oct 24 19:40:27 2014 +0000
@@ -1,50 +1,13 @@
+//    NUCLEO-072 n.1       NUCLEO-072 n.2
+//    TX-A0 ----------------- RX-A1
+//    RX-A1 ----------------- TX-A0
+//    GND   ----------------- GND
 
-// By: www.emcu.it
-// Tested on NUCLEO_L152RE
-// for more info see here: http://www.emcu.it/NUCLEOevaBoards/U2andL152/U2andL152.html#How_to_use_USART2
-//
-/*
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-//
-// This program send a character (E) via USART2 by pressing USER button (Blue Button) on NUCLEO board.
-// For test this example are necessary two NUCLEO-L152RE connected as shown below.
-//
-//    NUCLEO-L152RE n.1       NUCLEO-L152RE n.2
-//    TX-D1 ----------------- RX-D0
-//    RX-D0 ----------------- TX-D1
-//    GND   ----------------- GND
-//
-// ATTENTION:
-// For connect USART2 to D1/TX and D0/RX it is necessary do a bridge on SB63 and SB62 and
-// it is also necessary remove the bridge (0 ohm resistor) from SB13 and SB14.
-// SB62,62,13 and SB14 are on the rear of NUCLEO_L152RE board 
-/*
-    After this modifications, you lost the possibility to use the virtual comm to connect 
-    the NUCLEO to the PC.
-
-*/
 
 
 #include "mbed.h"
  
-Serial pc(SERIAL_TX, SERIAL_RX);    // tx, rx
+Serial pc(A0, A1);    // tx, rx
 DigitalOut myled(LED1);             // This LED is on NUCLEO-L152RE
 DigitalIn BlueButton(USER_BUTTON);  // This is Blue-Button and is on NUCLEO-L153RE