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.
Fork of USBSerial_HelloWorld by
Revision 10:aed18128d16d, committed 2015-12-21
- Comitter:
- zapta
- Date:
- Mon Dec 21 07:12:39 2015 +0000
- Parent:
- 9:d88699a0905a
- Commit message:
- .
Changed in this revision
--- a/USBDevice.lib Fri Mar 01 13:33:02 2013 +0000 +++ b/USBDevice.lib Mon Dec 21 07:12:39 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/USBDevice/#335f2506f422 +http://mbed.org/users/mbed_official/code/USBDevice/#2af474687369
--- a/main.cpp Fri Mar 01 13:33:02 2013 +0000
+++ b/main.cpp Mon Dec 21 07:12:39 2015 +0000
@@ -1,14 +1,34 @@
#include "mbed.h"
#include "USBSerial.h"
-//Virtual serial port over USB
-USBSerial serial;
-
-int main(void) {
+DigitalOut led(P0_20); // LED pin
- while(1)
- {
- serial.printf("I am a virtual serial port\r\n");
- wait(1);
- }
-}
\ No newline at end of file
+//Virtual serial port over USB
+USBSerial usb_serial;
+
+// Hardware serial to wifi device.
+Serial wifi_serial(P0_19, P0_18); // tx, rx
+
+Timer timer;
+
+void setup() {
+ timer.start();
+ wifi_serial.baud(19200);
+}
+
+void loop() {
+ if (timer.read_ms() < 200) {
+ return;
+ }
+ led = !led; // Invert LED state
+ timer.reset();
+ usb_serial.printf("usb\r\n");
+ wifi_serial.printf("wifi\r\n");
+}
+
+int main(void) {
+ setup();
+ for(;;) {
+ loop();
+ }
+}
--- a/mbed.bld Fri Mar 01 13:33:02 2013 +0000 +++ b/mbed.bld Mon Dec 21 07:12:39 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/3d0ef94e36ec \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/e188a91d3eaa \ No newline at end of file
