Momo Medical / Momo_Pilot_1

Dependencies:   ADS1015 MPU6050 PixelArray mbed

Fork of Momo_New by Momo Medical

Files at this revision

API Documentation at this revision

Comitter:
DEldering
Date:
Mon Aug 28 10:16:59 2017 +0000
Child:
1:a8e61f3910ad
Commit message:
Pre PE integration

Changed in this revision

ADS1115-hello_world/ADS1015.lib Show annotated file Show diff for this revision Revisions of this file
ADS1115-hello_world/MPU6050.lib Show annotated file Show diff for this revision Revisions of this file
ADS1115-hello_world/USBDevice.lib Show annotated file Show diff for this revision Revisions of this file
ADS1115-hello_world/main.cpp Show annotated file Show diff for this revision Revisions of this file
ADS1115-hello_world/mbed.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ADS1115-hello_world/ADS1015.lib	Mon Aug 28 10:16:59 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/arve0/code/ADS1015/#da5d0da65437
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ADS1115-hello_world/MPU6050.lib	Mon Aug 28 10:16:59 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Sissors/code/MPU6050/#580478f13283
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ADS1115-hello_world/USBDevice.lib	Mon Aug 28 10:16:59 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/USBDevice/#849c0c0f2769
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ADS1115-hello_world/main.cpp	Mon Aug 28 10:16:59 2017 +0000
@@ -0,0 +1,43 @@
+#include "mbed.h"
+#include "Adafruit_ADS1015.h"
+#include "USBSerial.h"
+#include "MPU6050.h"
+#define SERIAL_BAUD_RATE    115200
+
+MPU6050 ark(p9,p10);
+I2C i2c(p28, p27);
+Adafruit_ADS1115 ads0(&i2c, 0x48);
+Adafruit_ADS1115 ads1(&i2c, 0x49);
+//Adafruit_ADS1115 ads2(&i2c, 0x4A);
+Serial pc(USBTX, USBRX); // tx, rx
+Ticker sample;
+short read[8];
+int done;
+int j;
+int k;
+float acce[3];
+
+void read_adc()
+{
+    for (k = 0; k < 4; k = k + 1) {
+    read[k]=    ads0.readADC_SingleEnded(k);
+    read[k+4]=  ads1.readADC_SingleEnded(k);
+    }
+    ark.getAccelero(acce);
+    j = acce[0]*10;
+    pc.printf(",%d,%d,%d,%d,%d,%d,%d,%d,%d,\r\n", read[1], read[0], read[4], read[7], read[5], read[6], read[2], read[3],j); // print 'read' array to serial port
+    //pi.printf(",%d,%d,%d,%d,%d,%d,%d,%d,\r\n", read[1], read[0], read[4], read[7], read[5], read[6], read[2], read[3]); // print 'read' array to serial port
+}
+
+int main()
+{
+    i2c.frequency(400000);
+    pc.baud(115200);
+    //pi.baud(115200);
+    ads0.setGain(GAIN_ONE); // set range to +/-4.096V
+    ads1.setGain(GAIN_ONE); // set range to +/-4.096V
+    sample.attach_us(&read_adc, 100000);
+    while (1) {
+        wait_ms(101); // wait indefinitely because the ticker restarts every 50 ms
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ADS1115-hello_world/mbed.lib	Mon Aug 28 10:16:59 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/#979f092756bd