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:4b02ac4bd3dd
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Aug 04 18:38:10 2020 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+
+Serial pc(USBTX, USBRX); // tx, rx
+
+DigitalOut led_rojo(LED_RED);
+DigitalOut led_verde(LED_GREEN);
+DigitalOut led_azul(LED_BLUE);
+
+int main()
+{
+ pc.printf("Presione 'H' para encender LED1 o 'L' para apagarlo\n");
+
+ while(1)
+ {
+ char c = pc.getc();
+ if(c == 'H')
+ {
+ led_rojo=0;
+ led_verde=0;
+ led_azul=0;
+ }
+ if(c == 'L')
+ {
+ led_rojo=1;
+ led_verde=1;
+ led_azul=1;
+ }
+ }
+}
\ No newline at end of file