Back Ground: Currently working on a project, the goal is to control an automotive roof with state flow. As state flow allows for the use of simulink and matlab functions it can be very useful.
Before the roof can run its normal program it must initialise, this state allows for the counting of the steps to determine the size of the roof. The signals for the counting are provided by the hall sensor. The counting blocks have already been made, the counts however must be saved in the EEPROM.
Problem: Every time the subsystems counts, a value is written to the EEPROM. It is widely known the writing to an EEPROM must be limited. in this situation. 10 total counts equals to 10 x writing in the EEPROM.
Goal: I need to save the final value. Say i have 65 counts, I need to save the number 65 in the EEPROM and not 1,2,3,4,5...64, and finally overwrite all of those values with 65. I tried delays, and several array blocks but can't get it too work. Any ideas?