|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#7
|
|||||
|
|||||
|
Re: problem with using a loop
You definitely want an if statement.
Code:
if ( (p1_x > 122) && (p1_x < 132) && rc_dig_in01 )
pwm11 = 50;
Note that I made it test to see that p1_x is in a range around 127, instead of exactly 127. Joysticks will almost never return to exactly center when you let go of them, and the center point will sometimes change with time. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Loop time for OperatorControl function? Debug blows... | Chris_Elston | Programming | 10 | 13-02-2006 14:42 |
| While Loop Require in OperatorControl? | Chris_Elston | Programming | 2 | 15-01-2006 14:29 |
| Need a realistic Statics Problem | sanddrag | Technical Discussion | 10 | 05-12-2005 15:07 |
| arm-limitting gyro PD loop producing some strange results | ZZII 527 | Programming | 8 | 16-02-2005 02:30 |
| Rewriting main loop | Max Lobovsky | Programming | 4 | 04-01-2005 18:35 |