cancel
Showing results for 
Search instead for 
Did you mean: 

Trialstand: External Accelerometer with STM32F411CEU

timbo2023
Associate III

F. U. I.:

 

I would like to read sensor data from my accelerometer (MPU 6050) with the I²C-protocol.

My aim is to present the sensor data on my laptop via /dev/ttyUSB0, but no data reached my USB TO TTL-Adapter.

Attached you will find the code snippet and a photo.

 

(1)

I get no sensor data via I²C to my STM32F411.

What is wrong there?

The init-functions seems to be right, but the I2C_byteRead() gives no data back.

(2)

I would like to send my sensor data to PA2 (USART2, TX).

How can I realize this per code?

 

Thank's a lot.

 

Greetings

TIMBO

#

 

11 REPLIES 11

How do you know that?

timbo2023
Associate III

In my opinion it is a failure with the while()-loops in the function I2C1_byteRead.

Do you know an alternative?

It should start with

while(I2C1->SR2 & 2);

// wait until bus is not busy....