Manejo de bluetooth con un motor

Dependencies:   SoftSerial mbed

Files at this revision

API Documentation at this revision

Comitter:
YARodriguez
Date:
Fri Oct 06 14:39:40 2017 +0000
Commit message:
Manejo de bluetooth con un motor

Changed in this revision

SoftSerial.lib Show annotated file Show diff for this revision Revisions of this file
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
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