2023-12-07 01:08 PM
Hello to all!
I'm a bit new to STM8 programming. I'm my current project using the STM8L052 board, my plan is to use a input of how many times the user press a button to activate or deactive a function. For example, if the user press the button 5 times during the initialization process of the board, the function is activated. In the next initialization, the function must be active as well. However, if the user press the button 5 times again during another initialization, the function must be deactivated. My logic is as follows:
>> Initialization
- func (check flash memory) -> check if the memory location has the value (X var) to activate the desired A function
- func (check if the button was pressed 5 times) -> if the user press the button 5 times, changes the value of the memory location which holds X var value. If not pressed, the value stays the same (A function status does not change)
>> Initialization ends
>> function is executed or not
What I'm doing wrong? The pressing of the button does not change the state of the A function activation var
Thanks!
2023-12-10 10:56 AM
How do you change in flash the memory location that have the variable X?
And STM8L052 have 256-bytes of EEPROM.