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.
Diff: main.cpp
- Revision:
- 0:3aa4ba0ada56
- Child:
- 1:076e709173c9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Oct 23 13:51:26 2020 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+
+Serial pc(USBTX, USBRX);
+DigitalOut led(LED1);
+
+int main()
+{
+ pc.printf("Press '1' to turn LED1 ON, '0' to turn it OFF\n");
+ led=1;
+ while(1) {
+ char c = pc.getc(); // Read hyperterminal
+ if (c == '0') {
+ led = 0; // OFF
+ }
+ if (c == '1') {
+ led = 1; // ON
+ }
+ }
+}