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

Files at this revision

API Documentation at this revision

Comitter:
montanari9
Date:
Fri Oct 24 19:40:27 2014 +0000
Parent:
2:7ddee354bdfa
Commit message:
STM32F072 Nucleo - two boards connected thru USART4, turn on LED when BUTTON is pressed, no hardware change is needed

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-src.lib Show annotated file Show diff for this revision Revisions of this file
--- 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
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-src.lib	Fri Oct 24 19:40:27 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-src/#2c37f9c21d44