How to transmit external sensor data via bluetooth with Feather M0 Bluefruit LE

Hello,

I am trying to transmit the ADXL345 data via Bluetooth with Feather M0 Bluefruit LE now. The ADXL345 is connected to Feather M0 Bluefruit LE with SPI mode. I know the BLE communicates with MCU by SPI also. To avoid transmission collision, I change the connection mode from SPI to I2C for ADXL345. However, The data values received in mobile App are not right. I have attached the program as follow. Anybody who can help to solve this problem?

Thank you in advance.

Kind regards
Tang

Bluefruit_LE_ADXL345_I2C_BLE_20170307.ino (5.15 KB)

However, The data values received in mobile App are not right

How do you know that?

Hello,

I know the data in APP is not right because it is always the same value for x-axis, and also for y and z. Do you have any idea about it? Or do you know anybody who succeeds in transmitting the sensor data via BLE with this board?

Thank you very much.

Kind regards
Tang

Do you have any idea about it?

I have an idea that you are trying to do far too much all at once.

I can not figure out that hardware you have. It does not appear that you have an Arduino at all.

Post links to all the hardware you are using.

I can not figure out what is connected to what.

Post a schematic.

SPI is a bus. A bus has lots of seats. You can have multiple devices on the bus, with no problems. There was no reason to change to I2C. There is nothing in your post to indicate that you did that right, or that you connected the device to the proper pins.

Hello,

Thank you for your kind reply.
Now I connect ADXL345 Programming and Calibration | ADXL345 Digital Accelerometer | Adafruit Learning System with Bluefruit LE Overview | Adafruit Feather M0 Bluefruit LE | Adafruit Learning System together with SPI (or I2C). The data is right when I just use serial output without BLE (I have analysed the data collected by Matlab). However, it seems that BLE affects the data transmission from sensor to MPU When I add the code about BLE. The wire connection should be right for SPI and I2C, because I can get the right data via seiral port.
The schematic is showing on this website.
Overview | Adafruit Feather M0 Bluefruit LE | Adafruit Learning System

Sorry to trouble you. Thank you very much.

Kind regards
Tang