The connection are:#include "mbed.h"
Serial pc(SERIAL_TX, SERIAL_RX); // tx, rx
DigitalOut myled(LED1); // This LED is on NUCLEO-L152RE
DigitalIn BlueButton(USER_BUTTON); // This is Blue-Button and is on NUCLEO-L153RE
#define Pressed 0
#define NotPressed 1
int Car='\0';
int main() {
while(1)
{
if (BlueButton == Pressed)
pc.putc('E');
if(pc.readable())
{
Car = pc.getc();
if (Car == 'E')
{
myled = 1;
wait(0.1);
}
myled = 0;
Car = '\0';
}
}
}