|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
hello
,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 ![]() |
|
#2
|
|||
|
|||
|
Re: pwm outputs vs. joystick y-axis
pwm01=pwm02= yourJoystick_Y_axis;
|
|
#3
|
|||
|
|||
|
sweet. now does anyone know what the code for a shaft encoder would look like?
|
|
#4
|
|||
|
|||
|
Re: pwm outputs vs. joystick y-axis
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
![]() |
|
#5
|
|||
|
|||
|
thanks
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Inverting Y axis on joystick | FormatteD_C | Programming | 7 | 24-02-2004 16:56 |
| Changing 1 joystick code to 2 (rookie team) | Brawler006 | Programming | 5 | 20-02-2004 17:00 |
| Trouble with pwm outputs | misterikkit | Programming | 16 | 17-01-2004 10:56 |
| relay and pwm outputs | nick_champ_2 | Electrical | 1 | 31-01-2003 13:08 |
| switching joystick axis????? | team222badbrad | Technical Discussion | 9 | 16-01-2002 23:07 |