control de servo con bt
Dependencies: Servo SoftSerial mbed
main.cpp
- Committer:
- briandk
- Date:
- 2017-10-07
- Revision:
- 0:2acb15ba6059
- Child:
- 1:998b1ef95a89
File content as of revision 0:2acb15ba6059:
#include "mbed.h" #include "SoftSerial.h" //#include "Servo.h" PwmOut servo(PB_5); Serial pc (USBTX,USBRX); 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); servo.write(vel); } } }