thank u Ttelmah
i u got the problem...
i always use the int16 and it divide by 4 and if it is float the motor didn't run...
Ttelmah
Joined: 11 Mar 2010 Posts: 19537
Posted: Fri Feb 20, 2015 1:19 am
Glad you got there.
You can always 'force' the function to use whichever version you actually want, by using a 'cast'. So:
Code:
float fred;
fred=1000.0;
set_pwm1_duty((int8)(fred/4));
Will force the 'int8 ' version of the function to be used, even though you are handing the function a 'float' (which will always default to using the int16 version - code always uses the _highest_ type from those available if a type doesn't actually fit the choices).
All times are GMT - 6 Hours Goto page Previous1, 2
Page 2 of 2
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum