Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Arduino:how to use setStepMode(?) for tic834

#1

hello, i feel a kind of stupid, but i can’t figure out what parameter(s) a setStepMode() call should/can have. Everytime the compiler is complaining about it.
I want to be able in runtime to change the step_mode, so i want to pass a variable let’s name it s_mode.
What value should this variable have to be accepted by the function cq the compiler.

thanks in advance.
rolf

#2

Hello, Rolf.

You can use a variable of the enumerated type TicStepMode to do what you are describing.

You can define the variable name using:

TicStepMode sm;

Then, you can use that variable to store the step mode in your sketch. For example:

if (condition)
{
  sm = TicStepMode::Full;
}
else
{
  sm = TicStepMode::Half;
}

When you want to update the step mode, you can call:

tic.setStepMode(sm);

Brandon

#3

thanks BrandonM. I am happy with your suggestion: the compiler now accepts my code.
I still had to find the naming for the (other) micro-stepping modes, but stimulated by your mail i finally found those ones too, deep down in the Arduino library documentation. (Microstep1 (==Full), Microstep2 (==Half), Microstep4, Microstep8, Microstep16, Microstep32).

rolf

1 Like