I have the radio shack memsic dual axis accelerometer made by parallax model #mx2125 here[url=http://http://forums.parallax.com/showthread.php?76042-How-to-Accelerometer-%281%29-Fundamentals-and-Tilt-Measurement] http://forums.parallax.com/showthread.php?76042-How-to-Accelerometer-%281%29-Fundamentals-and-Tilt-Measurement[/url] I also have the grove motor shield (I do not recommend this product to anyone) here http://www.seeedstudio.com/wiki/Motor_Shield and arduino uno here arduino.cc and I am using 2 geared dc motors from a dollar store rc car
how do I change the pwm motor speed depending on the y axis out put from the accelerometer? for example. if output is 0 degrees then motor is off but from 1 degrees to 45 degrees the motor will be on and the higher the degree of angle, the faster the motor speed up to pwm max = 255? for 45 degree angle
and then to make it more confusing, I need to do the same for -1 deg to -45 deg but if the var is negative, then the motor needs to run backwards too.
can this be set up for smooth motor speed changes instead of jerking? you have probably guessed by now, yes. it is the self balance robot gimmick. I will make some pics of the hardware build so far.
seeed screwed me with the motor shield blocking all unused pins so I bought 2 mini breadboards and mounted the motor shield to that and ran jumper from that to my arduino so I could use the rest of my pins on arduino... seeed grove motor shield sucks.