Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 1:e9cb1aec787c
- Parent:
- 0:ab5b6bca3e25
- Child:
- 2:300f689e33b5
diff -r ab5b6bca3e25 -r e9cb1aec787c main.cpp
--- a/main.cpp Mon Nov 06 01:09:21 2017 +0000
+++ b/main.cpp Mon Nov 06 01:12:21 2017 +0000
@@ -2,6 +2,16 @@
/* MATLAB can send data over to the Nucleo to control its operation or
to output data via AnalogOut, etc. In this case, MATLAB sends a number and the
onboard LED is set to blink that many times in 2 seconds.
+
+MATLAB can connect to Nucleo using the serial object defined in MATLAB.
+Here is MATLAB code to send number:
+
+>> nucleo = serial('COM3','BaudRate',9600); %(replace with your COM channel)
+>> fopen(nucleo);
+>> fprintf(nucleo,'5\n'); %This line can be repeated with values other than 5
+>> fclose(nucleo); %When you are all done, close connection
+>> clear s; %Clear object from memory
+
*/
PwmOut light(LED1);
Serial matlab(USBTX,USBRX);