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.
Diff: main.cpp
- Revision:
- 4:dfb1c26a6cca
- Parent:
- 3:92a1d031708b
--- a/main.cpp Wed Oct 28 19:53:26 2015 +0000
+++ b/main.cpp Sat Oct 31 23:02:35 2015 +0000
@@ -16,6 +16,7 @@
#define MMA8451_I2C_ADDRESS (0x1d<<1) // accel address
+Serial pc(USBTX,USBRX);
// accel comes from MMA8451Q.CPP library
struct xyz{
@@ -52,9 +53,9 @@
}
void send_data(struct xyz *data){
- printf("X = %f1.3,", data->x);
- printf("Y = %f1.3,", data->y);
- printf("Z = %f1.3 \r\n", data->z);
+ pc.printf("X = %f1.3,", data->x);
+ pc.printf("Y = %f1.3,", data->y);
+ pc.printf("Z = %f1.3 \r\n", data->z);
}
void read_accel(struct xyz *data, MMA8451Q acc)