libs for rover sensor package

Dependencies:   mbed LSM9DS1 HC-SR04 BNO055 MCP9808

Files at this revision

API Documentation at this revision

Comitter:
zachs1
Date:
Sat Oct 26 19:53:11 2019 +0000
Commit message:
init?;

Changed in this revision

BNO055.lib Show annotated file Show diff for this revision Revisions of this file
HC-SR04.lib Show annotated file Show diff for this revision Revisions of this file
LSM9DS1.lib Show annotated file Show diff for this revision Revisions of this file
MCP9808.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
diff -r 000000000000 -r ec9236781366 BNO055.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BNO055.lib	Sat Oct 26 19:53:11 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/zachs1/code/BNO055/#2eda0843ef6d
diff -r 000000000000 -r ec9236781366 HC-SR04.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HC-SR04.lib	Sat Oct 26 19:53:11 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/Nestordp/code/HC-SR04/#be89035b2c42
diff -r 000000000000 -r ec9236781366 LSM9DS1.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LSM9DS1.lib	Sat Oct 26 19:53:11 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/beanmachine44/code/LSM9DS1/#0e76f237c23d
diff -r 000000000000 -r ec9236781366 MCP9808.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MCP9808.lib	Sat Oct 26 19:53:11 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/stumpi/code/MCP9808/#f8e8cccfd476
diff -r 000000000000 -r ec9236781366 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Oct 26 19:53:11 2019 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+#include "BNO055.h"
+
+#define SENSOR_9D0F_ADDR    (0x28 << 1) // 9D0F address
+#define CHIP_ID_REG         (0x0)       // Chip ID (regval = 8'b10100000 == 0xA)
+// I2C i2c(I2C_SDA, I2C_SCL);
+
+BNO055 sensor_9D0F = BNO055(I2C_SDA, I2C_SCL);
+ 
+Serial pc(SERIAL_TX, SERIAL_RX);
+ 
+int main()
+{
+    // Ping 9D0F sensor
+    if( !sensor_9D0F.check() )  //read returns 0 on ACK
+    {
+        pc.printf("I2C Failed to 9D0F sensor");
+    } 
+    else
+    {
+        pc.printf("I2C connection established with 9D0F");
+    }
+    sensor_9D0F.setmode(OPERATION_MODE_ACCONLY);
+    
+    while (1) {
+        sensor_9D0F.get_accel();
+        printf( " Accel x (raw): %d\n Accel y (raw): %d\n Accel z (raw): %d\n Accel x (scaled): %f\n Accel y (scaled): %f\n Accel z (scaled): %f\n",
+                 sensor_9D0F.accel.rawx, sensor_9D0F.accel.rawy, sensor_9D0F.accel.rawz, 
+                 sensor_9D0F.accel.x, sensor_9D0F.accel.y, sensor_9D0F.accel.z);
+        
+        wait(0.25);
+    }
+ 
+}
+ 
diff -r 000000000000 -r ec9236781366 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Oct 26 19:53:11 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file