Quote:
Originally Posted by tb0508
So, to get the values that you used of 200 to 800 with the center being 500. Is that the same as me using the min and max of the steering wheel pot?
|
Probably, but not necessarily; think about the values you're trying to convert, rather than how to plug it into an equation. The graph below shows an example mapping of input values to output values. The input is the x-axis; these are the readings you get from the steering wheel. The output is the y axis; these are the desired positions for the output. Draw this graph for whatever values you have, and the equation for Y in terms of X will follow naturally from that.
Quote:
Originally Posted by tb0508
Also, I plan to send the outputPower value to the roboclaw to determine left/right and how fast. Is this correct way? And I am a little confused on how exactly to send the value/data to the roboclaw for it to interpret.
|
Look through the Roboclaw
datasheet and
Arduino examples, if you haven't already. In theory you could use any of the four control modes the RoboClaw allows.
As a side note, it would be simpler and more efficient to use Serial.write() and Serial.read() to send the bytes directly, rather than converting them to character strings and back. But if you've got it working with print() and atoi(), then carry on!