bluetooth
Dependencies: mbed SoftSerial
Revision 2:41c5047f946f, committed 2019-01-22
- Comitter:
- mariangelamone
- Date:
- Tue Jan 22 22:15:39 2019 +0000
- Parent:
- 1:d33dca22f3a1
- Commit message:
- macchina pilotata da bluetooth
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r d33dca22f3a1 -r 41c5047f946f main.cpp --- a/main.cpp Fri Nov 16 11:37:29 2018 +0000 +++ b/main.cpp Tue Jan 22 22:15:39 2019 +0000 @@ -1,15 +1,9 @@ +//automobilina pilotata dai comandi bluetooth #include "mbed.h" #include "SoftSerial.h" -PwmOut mypwm(D6); - -PwmOut mypwm1(D5); +Serial pc(USBTX,USBRX); -PwmOut mypwm2(D9); - -PwmOut mypwm3(D10); -Serial pc(USBTX,USBRX); -DigitalOut myled(LED1); DigitalOut aa(D5); DigitalOut ab(D6); DigitalOut ba(D9); @@ -25,12 +19,7 @@ { if (bt.readable()>0) { - receive=bt.getc(); - //invio=bt.putc(); - //if(receive=='1')myled=!myled; //toggle - vel=receive-48; - vel/=10; - pc.printf("%c %f\n\r", receive, vel); + if(receive=='1'){ bt.printf("ciao"); aa=0; @@ -80,6 +69,6 @@ } } - mypwm.write(LED1); + } }