I have been googling and haven't found exactly what I am looking for. I am wondering if there is a way out there to test my code by using some data that I logged from the Arduino. I am trying to calculate a few things based off a consistent cycle on one of my presses using a pressure sensor and linear potentiometer, and I don't want to continue to run my press to test my code.
I would like to be able to test my code based off two raw analog signals that I got while the machine was running.
Can you also add a simple drawing of the analog voltage cycle you are trying to emulate.
You might be able to program another Arduino to generate the signals, or with one Arduino you would use a millis() timer to generate values which the program will respond.
What you are asking for is not exactly a code-simulator. Because you want to simulate sensor-input.
Depending on how much values you want to "feed in" into your code you could use an array and non-blocking timing to test your code.
You should post what exact type of microcontroller you are using.
If this datastream is much more than 200 values you could use python to read in all your data and send it via serial to your microcontroller.
If it doesn't matter for your testing that the values follow a certain reproducable sequence of values you could simply use the wokwi-simulator with a potentiometer.
Below is a snapshot of an example of the cycle I would like to drive my controller with for testing. There will be two datasets I am just waiting on the pressure transducers to collect that data as well. For reference the cycle is a 24 second cycle and I am collecting data every 20 ms to get the resolution I need. I did try wokwi, but I need to drive a specific cycle in as I need to write code to determine distances and pressures at certain parts of the cycle so I need something to represent an actual cycle on one of my machines.
Currently running this on a Nano RP2040 Connect to get the 12bit analog signal.
I will look into Python, might be able to get what I want from there.
Thanks everyone for the help here. I decided to take a stab at developing the code in excel based off a log of the signals and got it to work that way. Was easier than trying to learn a new process to do things. I still had some minor tweaking to do on the press but was able to get code 95% there with just using excel.