Simulator - mschafer/usb-motor-stepper GitHub Wiki
The simulator executes the device code on the host machine. It is instrumented to provide a record of every step taken during the execution of script. Consider an example script that describes a right triangle in the x-y plane with sides length 3, 4, and 5.
# a sample script that describes a triangle in the x-y plane line x 4 1000 line y 3 1000 line x -4 y -3 1000Run this through the simulator from the command line interface using the stepper program.
% stepper triangle.steps
The result will be a sim.out file with a line for each step.
% cat sim.out X Y Z U time 1 0 0 0 1 2 0 0 0 1001 3 0 0 0 2001 4 0 0 0 3001 4 1 0 0 4001 4 2 0 0 5001 4 3 0 0 6001 3 2 0 0 7001 2 2 0 0 8001 1 1 0 0 9001 0 0 0 0 10001 0 0 0 0 11001The first line has column headers with the axis names and the label time. Note that the first command will always happen at time 1 not 0 and the last position will be duplicated because the stepper does wait the final delay even though there are no more commands. The columns are tab delimited so the text file can be easily read into a spreadsheet or similar tool for plotting.