alexandra rodriguez
/
BLUETOOTH
Manejo de bluetooth con un motor
Revision 0:1cd78549370a, committed 2017-10-06
- Comitter:
- YARodriguez
- Date:
- Fri Oct 06 14:39:40 2017 +0000
- Commit message:
- Manejo de bluetooth con un motor
Changed in this revision
diff -r 000000000000 -r 1cd78549370a SoftSerial.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SoftSerial.lib Fri Oct 06 14:39:40 2017 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/Sissors/code/SoftSerial/#a0029614de72
diff -r 000000000000 -r 1cd78549370a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Oct 06 14:39:40 2017 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "SoftSerial.h" + +PwmOut mypwm(D5); +Serial pc(USBTX,USBRX); +DigitalOut myled(LED1); +SoftSerial bt(D2,D3); + +char receive; +float vel; +int main() +{ + while(1) + { + if (bt.readable()>0) + { + receive=bt.getc(); + vel=receive-48; + vel/=10; + pc.printf("%c %f\n\r", receive, vel); + } + mypwm.write(vel); + } +}
diff -r 000000000000 -r 1cd78549370a mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Oct 06 14:39:40 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a330f0fddbec \ No newline at end of file