
prove
Revision 0:56782abc55c7, committed 2019-03-05
- Comitter:
- CCastrop1012
- Date:
- Tue Mar 05 01:28:53 2019 +0000
- Commit message:
- n1;
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 Mar 05 01:28:53 2019 +0000 @@ -0,0 +1,59 @@ +#include "mbed.h" + +PwmOut pwm1(LED1); +PwmOut pwm2(PB_8); + +Serial pc(SERIAL_TX, SERIAL_RX); + + + +float leerUart(void); + +//DigitalOut myled(LED1); + + + + +int main() +{ + + float dpwm1 = 0.0; + float dpwm2 = 0.0; + + pwm1.period(1); + pwm2.period(1); + + while(1){ + + pwm1 = leerUart(); + wait(2); + pwm2 = leerUart(); + wait(2); + + } + + + +} + + +float leerUart(void) +{ + uint8_t valor_periodo; + + + valor_periodo = pc. getc(); + + if(valor_periodo < 100) + + return((float)valor_periodo/100); + + else + + return 1; + + + + } + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Mar 05 01:28:53 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc \ No newline at end of file