first accel code

Dependencies:   MMA8451Q mbed

Files at this revision

API Documentation at this revision

Comitter:
aramnhammer
Date:
Sat Oct 31 23:02:35 2015 +0000
Parent:
3:92a1d031708b
Commit message:
serial pc test

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- 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)