Hi all,
this is my first time posting, but I've searched the forum extensively and can't fix my problem. I have already examined Robin2's "Demonstration code for several things at the same time" and still cannot apply it to my code.
-
I am running 3 stepper motors using ST-M5045 drivers and an external 12V power supply.
-
I am also running 2 loadcells, one for measuring downward force and one for measuring tension, that take separate readings. They are using hx711 loadcell amplifiers.
-
There is a switch and a button. The switch changes between a tension check and the motion of the stepper motors. The button begins the motion, and has no function when the switch is LOW.
I have been able to get all of the parts to function as intended independently, but when I run the stepper motors, it blocks the sensor data from being printed in the serial monitor. It is crucial to my project that I am able to measure downward force off one of the loadcells while the stepper motors are still moving.
My main questions are:
-
How can I make the stepper motors run without blocking the sensor data? or do I need to use 2 arduinos?
-
Is the data still being read, and just the print function is being blocked? If my end goal is to export the sensor readings to excel automatically, will that be blocked by the stepper motion as well?
I cannot fit my code in this post because it is too long. I will put (a shortened version of) it in the first reply. I appreciate any feedback in advance. Thanks.