Reading position information on arduino serial port screen with "Tic T825"

Hello, I’m trying to control a Tic T825 with Arduino. I have a problem. I want to read the current position information when the motor starts on the Arduino serial port screen. Which function should I use, can you help me? Thanks.

Hello.

I moved your post to the “Motor controllers/drivers and motors” section of the forum since it seemed more appropriate.

If you are using our Tic Stepper Motor Controller library for Arduino, you can use the getCurrentPosition() command. I am not sure if you are using the Tic’s serial or I2C interface, but you can see examples of using this command for each in the I2CPositionControl and SerialPositionControl examples, respectively.

Brandon

Thank you for your answer.
Yes I am using the SerialPositionControl example. I can starting the engine in the position I want.

But when I try the code like this,

Veriable = getCurrentPosition() ;
Serial.println(Veriable);

I cannot view the variable value. The code does not work. I wonder if I’m using the function the wrong way.

Just to clarify, you will need to use the name of the object when calling the command (e.g. the SerialPositionControl example uses tic.getCurrentPosition()).

If what you had in your post was just an example, and you are already doing that, could you post more details about what you are trying and what is happening? For example, could you post the simplest complete program that demonstrates the problem? What value do you expect it to return and what value are you getting instead? Does the unmodified SerialPositionControl example work as expected?

Brandon

I want to instantly read “Current position” data (with square sign) on Arduino as in Tic Control Center. How do I do this is my question?

As I described in my previous posts, the getCurrentPosition() function from our Tic Stepper Motor Controller library for Arduino should return that value. So, you can set a variable equal to tic.getCurrentPosition() and print it out using Serial.println(); however, please note that the returned value is a signed 32-bit integer, so the variable should be defined as a int32_t type.

If you are trying to do this and having problems, can you answer the questions from my previous post?

Brandon

new_stepper.ino (1.6 KB)

Hi,

Please use the “void position ();” triggered by Timer. Check out the blog. I cannot view the “currentpos” value in this way. The code gets stuck in that part.

I am grateful to you for your interest. Thank you.

I will be waiting for an answer from you.

Thank you for posting your code. It does not look like that code is ever actually calling the getCurrentPosition() command in it the main loop. Are you saying that it hangs if you add a line to call your pozisyon()function?

What Arduino are you using? Could you post pictures of your setup that show all of your connections?

Brandon