could someone show me a example code showing how I could use map and smooth
to take x axis +/- data from my accelerometer(tilt + or - variable) and use map and smooth to change the variable to set pwm to motor shield
can smooth be used with this?
The map() function takes a value that might be in one range and maps it to another range. The value might be a potentiometer reading, in the range 0 to 1023, and the other range might be 0 to 180, to position a servo. The potentiometer reading maps to a servo position, then.
I don't see how the map function is going to help you.
I have no idea what smooth function you are talking about.
It appears that you don't understand what you are getting from your accelerometer, either.
There are a number of projects in the robotics part of the forum that detail building self balancing robots. You need to spend some time there.
I was just thinking that using these with the accelerometer output to control the motors..
I already have code making the motors move according to the accelerometer output but it is jerky as hell and wont stay balanced at all (but the motors do move the right direction.