| | RE: Converting a float to an integer Michael Marklew
| | | I have built a plotter and want to draw a diagonal line of varying angles. It requires one motor to run slower then the other at a ratio based on the distance it has to travel compared to the other one. So I do something like this xspeed = (int) (...) (23 years ago, 9-May-02, to lugnet.robotics.rcx.legos)
| | | | | | | | Re: Converting a float to an integer Benton Jackson
| | | | | It looks like xdist and ydist are integers. You divide an integer by an integer, the answer is an integer. For example, if xdist=5 and ydist=10, you have 5/10, the answer is 0 (with a remainder of 5). So, if you do the multiply first, you will be (...) (23 years ago, 13-May-02, to lugnet.robotics.rcx.legos)
| | | | | | |