siteswapjuggler / RAMP

Arduino Interpolation Library
GNU General Public License v3.0
139 stars 23 forks source link

Set ramp_mode with a variable #25

Closed mircose closed 4 months ago

mircose commented 4 months ago

Hi, Thanks for your library

I want to set ramp_mode with a variable like:

int myRampMode=LINEAR; myRamp.go(100, 10000, myRampMode);

but I receive this error message: invalid conversion from 'int' to 'ramp_mode' [-fpermissive]

any solution?

siteswapjuggler commented 4 months ago

Actually your message is just a warning, it should compile without problem.

But if you want to do it the proper way juste use a type conversion or the proper enum type : int myRampMode = (int)LINEAR or ramp_mode myRampMode = LINEAR

Either should get rid of the warning.

Have a nice day

mircose commented 4 months ago

Thanks a lot