ADXL362 accelerometer hello world

Dependencies:   ADXL362 mbed

Dependents:   MPU-9250-Ch2

For additional information check out the mbed page of the Analog Devices wiki: https://wiki.analog.com/resources/tools-software/mbed-drivers-all

Files at this revision

API Documentation at this revision

Comitter:
adisuciu
Date:
Thu May 19 09:11:04 2016 +0000
Commit message:
Initial revision

Changed in this revision

ADXL362.lib Show annotated file Show diff for this revision Revisions of this file
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/ADXL362.lib	Thu May 19 09:11:04 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/teams/AnalogDevices/code/ADXL362/#2e21c4508cab
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu May 19 09:11:04 2016 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+#include "ADXL362.h"
+
+ADXL362 adxl362(D9);
+
+int main() {
+    
+    adxl362.reset();
+    wait_ms(600); // we need to wait at least 500ms after ADXL362 reset
+    adxl362.set_mode(ADXL362::MEASUREMENT);
+    uint8_t x,y,z; 
+    while(1) {
+        x=adxl362.scanx_u8();
+        y=adxl362.scany_u8();
+        z=adxl362.scanz_u8();
+        printf("x = %x y = %x z = %x\r\n",x,y,z);
+        wait_ms(100);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu May 19 09:11:04 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7c328cabac7e
\ No newline at end of file