2025-03-23 5:42 PM - edited 2025-03-23 5:46 PM
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
#
2025-03-24 9:35 AM
How do you know that?
2025-03-24 11:25 AM
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....