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.
Revision 0:f9424a117b32, committed 2016-03-09
- Comitter:
- alexD
- Date:
- Wed Mar 09 08:22:14 2016 +0000
- Commit message:
- Test;
Changed in this revision
| 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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Mar 09 08:22:14 2016 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+
+// init i2c
+I2C i2c(p28, p27);
+
+// bluetooth
+Serial blue(p9, p10);
+// pc console
+Serial pc(USBTX, USBRX);
+
+// slave address
+const int addr = 0x20;
+
+int main()
+{
+ char cmd[10];
+ blue.baud(9600);
+ pc.baud(9600);
+ //i2c.frequency(50000);
+ cmd[0] = 100;
+ while (1) {
+ if (blue.readable()) {
+ cmd[0] = blue.getc();
+ pc.printf("%d", cmd[0]);
+ i2c.write(addr, cmd, 1);
+ }
+
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Mar 09 08:22:14 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/87f2f5183dfb \ No newline at end of file