Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:1cd78549370a
- Child:
- 1:d33dca22f3a1
--- /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);
+ }
+}