Accelero

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
wallsow
Date:
Fri Jan 06 13:28:04 2017 +0000
Commit message:
Accelero

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
diff -r 000000000000 -r 86b9171e7f89 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jan 06 13:28:04 2017 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+
+//***Gestion lecture et affichage de X, Y, Z ***********//
+AnalogIn inputx(PC_0); // input PC_0 for X axis
+AnalogIn inputy(PC_1); // input PC_1 for Y axis
+AnalogIn inputz(PB_1); // input PB_1 for Z axis
+//Serial pc(USBTX,USBRX);  //Serial class for transmission of serial data
+ 
+int main() {
+    //serial config
+    Serial serial(PA_0,PA_1);  /*PA_0=A0=TX PA_1=A0=RX*/
+    serial.baud(9600);
+    serial.format(8,SerialBase::None,1);
+    serial.printf("\r\n Accelero Test program");
+    serial.printf("\r\n******\r\n");
+    //char tmp[30];//="AT$SS=00 12 FF 42 \r\n";//$SS
+    
+   // pc.baud(9600);   // fixing a constant baud rate of 9600 bps at which mbed will interact with computer
+    float x=0,y=0,z=0; // variables for x,y,z axes
+    
+    while(1)
+    {  
+            
+        x = inputx;
+        y = inputy;
+        z = inputz;
+        serial.printf("X:%f,Y: %f,Z: %f *\r\n",x,y,z); 
+        wait(1);
+    }   
+}
\ No newline at end of file
diff -r 000000000000 -r 86b9171e7f89 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jan 06 13:28:04 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9baf128c2fab
\ No newline at end of file