alonso vallejo
/
lab1_gpio_out
lab1 para curso mbed FIME
Revision 0:b51a19b7d220, committed 2015-05-24
- Comitter:
- Alonso
- Date:
- Sun May 24 04:13:47 2015 +0000
- Commit message:
- lab1 para curso mbed FIME
Changed in this revision
diff -r 000000000000 -r b51a19b7d220 LED_RGB.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LED_RGB.cpp Sun May 24 04:13:47 2015 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "LED_RGB.h" + +DigitalOut rgb_rojo(PTB18,1); +DigitalOut rgb_verde(PTB19,1); +DigitalOut rgb_azul(PTD1,1); + +//#define retardo_ms 500 + +void RGB_BLINK(unsigned int retardo_ms) +{ + rgb_rojo.write(0); + wait_ms(retardo_ms); + rgb_rojo.write(1); + wait_ms(retardo_ms); + rgb_verde.write(0); + wait_ms(retardo_ms); + rgb_verde.write(1); + wait_ms(retardo_ms); + rgb_azul.write(0); + wait_ms(retardo_ms); + rgb_azul.write(1); + wait_ms(retardo_ms); +} \ No newline at end of file
diff -r 000000000000 -r b51a19b7d220 LED_RGB.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LED_RGB.h Sun May 24 04:13:47 2015 +0000 @@ -0,0 +1,7 @@ +#ifndef _LED_RGB_H +#define _LED_RGB_H + + +void RGB_BLINK(unsigned int retardo_ms); + +#endif \ No newline at end of file
diff -r 000000000000 -r b51a19b7d220 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun May 24 04:13:47 2015 +0000 @@ -0,0 +1,14 @@ +#include "mbed.h" +#include "LED_RGB.h" +/* En esta practica se realizan las configuraciones basicas para las entrada digitales en la tarjeta + en el rgb cambia entre color rojo, verde y azul con un retardo que depende del valor que se le + ponga en la funcion RGB_BLINK(), en valor debe estar en milisegundos*/ +int main() +{ + + while(1) + { + RGB_BLINK(100); + } +} +
diff -r 000000000000 -r b51a19b7d220 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun May 24 04:13:47 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/dbbf35b96557 \ No newline at end of file