hello :rolleyes: ,
ok, I’m kinda a newbie. for simplicity’s sake, lets say I have a robot with a single motor, and all I want it to do is go forward and backward. is there a way to make the robot adjust its speed according to how far the joystick is pushed forward or backward? rather than just when it reaches full forward or reverse. can you show me what the code would look like? if that isn’t possible, or easily done, can you send me what the code would look like to control the power going to the motor via a pwm. that would be super helpful because with that I can figure out most of the other stuff.
oh, and if you happen to know, how do I read from a shaft encoder that’s hooked up to a digital input.
thank you so much,
Stephen
pwm01=pwm02= yourJoystick_Y_axis;
sweet. now does anyone know what the code for a shaft encoder would look like?
check out Kevin Watson’s example code for using encoders. It is full of comments and very helpful. Or, just search around these forums, you are guaranteed to find what you are looking for
thanks :]