|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
programming help
Could someone help us with some p-basic language that would give us some programming in our joystick that would allow one wheel to turn at normal speed and one wheel to turn same direction but slower
![]() |
|
#2
|
|||||
|
|||||
|
Well, if you wanted your first wheel to go directly with the joystick, and you wanted your second wheel to go at about half that speed, you could do this:
pwm1 = p1_y if p1_y > 127 then pwm2 = (127 + (abs(127 - p1_y)/2)) if p1_y < 127 then pwm2 = (127 - (abs(127 - p1_y)/2)) That was just off the top of my head, but I think it will work. You can use any scaling factor, but if you want it to be faster than half speed, you will have to multiply by a fraction, rather than divide. Let's say you wanted it to be 3/4 speed. You would have to multiply by (3/4) instead of dividing by .75, because PBasic cannot do numbers less than 1. I suggest using constants if you're not sure what ratio you want it to be. Last edited by Skabana159 : 10-02-2003 at 13:20. |
|
#3
|
|||
|
|||
|
thanks
thank you for the information i will give it to the engineer
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming Compatition | Angela06 | Programming | 30 | 08-04-2005 23:12 |
| multi-bank programming problem | GregC | Programming | 3 | 14-02-2003 16:13 |
| Pneumatics electrical wiring and programming | archiver | 2001 | 1 | 23-06-2002 23:10 |
| Error found in programming for the pump and pressure switch | sjharobotics | Programming | 4 | 06-02-2002 17:46 |
| pbasic programming | punarhero | Programming | 4 | 21-01-2002 23:32 |