How to Save Float To STM32 EEPROM Arduino
Save Float Value To STM32 EEPROM
STM32 EEPROM is one of the important things that must be learned. STM32 does not have EEPROM by default, so we can use flash memory for EEPROM allocation.
|Save Float to EEPROM STM32|
This method is called STM32 EEPROM Emulation.
In the other article, I wrote a tutorial How to Access Read and Write EEPROM on STM32F103 Using Arduino IDE, which can store String data.
Well, complex programs often use float values because they can hold very detailed data.
For example, coordinate data to show an accurate location, requires data behind the comma of the float data.
The more numbers behind the comma, the more detailed the results of the object's position at these coordinates.
I tried to find out on the internet how to save float to EEPROM and reread the data stored on STM32 Blue Pill. But I did not find the right program.
For that reason, I made a program that can write float data and save to the STM32 EEPROM (in this case I am testing using STM32F103 Blue Pill) and read it again
EEPROMwrite command to write data. The data used must be a string, so Float Data must be Converted to String. The program below is a modification program from the stm32projects website.
The EEPROM STM32 Float Read and Write Program on Arduino IDE
The program below I wrote using Indonesian. You can replace it with your language.
|Float Data Read|
This program still has shortcomings. As you can see of Latitude, the initial value written is 96.124843, when it reads it again becomes 96.124840. I don't know the code for storing data with the amount of data above 8 characters correctly.
if you can resolve this, please comment below to help me improve this STM32 EEPROM article.
May be useful. That's all