Strange values when reading bytes from my I2C sensor [STM32L0]
I have a system of sensors connected to an STM32 chip, all working via I2C and 3.3V.
I've created interface libraries for my sensors, specifically the temperature and accelerometer ones. However, when I read the values measured by the sensors, I came across a strange result.
Here's a printout of the serial communication:
Starting...
Scanning I2C bus:
Device found at 0x18
Device found at 0x1F
Device found at 0x50
Device found at 0x51
Device found at 0x7C
I2C scan completed.
Ready KX122
Ready MCP9808
Error in MAX17048 connection
Ready FRAM
Ready!
Next Memory Adds: 0
Starting Temperature Reading:
Temp:
Temp: 1077936128
Starting Battery Reading:
Failed to read voltage
Failed to read SOC
Bat: 0
RMS Accel: -1067319296, 0, 1081114624
Starting Vibration Reading:
As you can see, the acceleration and temperature values are all wrong. They should be double values.
Temp: 1077936128
RMS Accel: -1067319296, 0, 1081114626
The library codes, my main.c file and its header files are in Firmware Tools.rar.
