Stuck on Mechanical Integrator coding

Hello, I am currently working on a project to create a mechanical integrator and I am wanting to use IDE to take an input of a function and its limits, then to use the y values of the function and output them to correlated stepper movements. I am new to IDE moving from MATLAB and I was wondering if there was any advice anyone could give on how to get an input, then to calculate values between limits of the function.

If you are just starting with Arduino, you will need to learn the basics of the C/C++ programming language, and the Arduino digital and analog interfaces.

The Arduino IDE comes with many example programs demonstrating the basic features, and there are plenty more tutorials on line.

you mean you want to be able to type something like y = sin(x) + sin(2*x) and then be able to use that function in your code ?

that's not an entry level task as C++ is not an interpreted language you can't just ask an underlying interpreter to evaluate the function, you'll have to write a parser for mathematical function (define the grammar etc)

can you post the MATLAB code to see what you're trying to do?

Just guessing..

You have a list of x,y points and you want to interpolate the function between the points?

Are we talking something like a spline curve fitting? Or just simple liner fit from point to point?

Or am I way off the track here?

'Cause I have a library that does the liner fitting thing..

basically I just want a user to type a mathematical function with 2 points into the serial monitor and the code will evaluate the limit at points in between while using each point at a movement for a stepper motor. I am stuck on inputting a mathematical function in the first place.

this is not "just" then, it's quite some work if you want to parse that yourself

What have you tried, and what are the problems?

I have gotten to the point where I can take an input of a short message, but not a mathematical function. Also I am trying to use the serial plotter and it is not graphing the y values of the function as y values, but rather x values

Those are two completely unrelated problems.

How about you post exactly what you see on the IDE screen right now? I'm not sure you're 'getting' the 'upload code and it automatically runs without intervention', but 'is hard to interact with' of the Arduino schema. Forgive me if you've just assumed we all know exactly what's in front of you.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.