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 PR2EJ7 by
Revision 0:1272b81992d4, committed 2017-11-06
- Comitter:
- carlospomar
- Date:
- Mon Nov 06 17:04:13 2017 +0000
- Child:
- 1:ee5228330793
- Commit message:
- Practica 2 ejercicio 7
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Nov 06 17:04:13 2017 +0000
@@ -0,0 +1,43 @@
+#include "mbed.h"
+#include "rtos.h"
+
+DigitalOut Led1(PB_3); // Led1 conectado al pin D3
+DigitalOut Led2(PB_5); // Led2 conectado al pin D4
+DigitalOut Led3(PB_4); // Led3 conectado al pin D5
+
+
+
+void blink1(void const *argument) {
+while (1) {
+ Led1 = !Led1;
+ Thread::wait(1000); //tiempo de espera para cambiar el led1 de estado
+ }
+ }
+
+
+void blink2(void const *argument) {
+while (1) {
+ Led2 = !Led2;
+ Thread::wait(1200); //tiempo de espera para cambiar el led2 de estado
+ }
+}
+
+void blink3(void const *argument) {
+
+while (1) {
+ Led3 = !Led3;
+ Thread::wait(1500); //tiempo de espera para cambiar el led3 de estado
+ }
+}
+
+int main()
+{
+Thread thread1(blink1, NULL, osPriorityNormal, DEFAULT_STACK_SIZE);
+Thread thread2(blink2, NULL, osPriorityNormal, DEFAULT_STACK_SIZE);
+Thread thread3(blink3, NULL, osPriorityNormal, DEFAULT_STACK_SIZE);
+while (true) {
+
+ Thread::wait(500);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-rtos.lib Mon Nov 06 17:04:13 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed-rtos/#5713cbbdb706
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Nov 06 17:04:13 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/fb8e0ae1cceb \ No newline at end of file
