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.
Revision 0:4b02ac4bd3dd, committed 2020-08-04
- Comitter:
- CHRISTIAN_GSL
- Date:
- Tue Aug 04 18:38:10 2020 +0000
- Commit message:
- Control de Led RGB mediante terminal serial, al oprimir la tecla H el Led RGB enciende en color blanco y al oprimir la tecla L, el Led RGB se apaga.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Aug 04 18:38:10 2020 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a330f0fddbec \ No newline at end of file