2024-10-25 05:12 AM - edited 2024-10-25 06:35 AM
I generated with MC Workbench some code sa use to program an inverter. I want to plot with the monitor the value read from the potentiometer, i.e., the value stored in "rawValue"
I had managed to graphically plot on the monitor "rawValue" variable used only in the two functions "potentiometer.c" and "speed_potentiometer.c" using a variable "pot" declared in main and reported in "potentiometer.c" as external (extern uint16_t pot):
The problem is that when I regenerate the code with the .ioc file .. everything I wrote inside this function (fortunately only two lines) is deleted!
How can I do to avoid this problem?
2024-10-28 10:33 AM
Hello @luke514,
You have to add this code between these two comment lines (see main.c file as example)
/* USER CODE BEGIN x */
new lines
/* USER CODE END x */
2024-10-28 12:37 PM
>>How can I do to avoid this problem?
Don't regenerate into your primary branch?
2024-10-28 12:43 PM
Can you explain more in detail?
Thanks