|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#3
|
|||||
|
|||||
|
Re: Negative numbers?
The joystick inputs are of type unsigned char. Trying to do arithmetic with them that yields negative results (e.g. p1_x - 127 when p1_x is less than 127) is just asking for things to blow up.
I get around the problem by reading the joystick input values into a temporary int first, and do all the computations with that. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Field Elements errors in part numbers | Mike Martus | Kit & Additional Hardware | 0 | 08-01-2005 19:05 |
| Pneumatic Part Numbers | CyberWolf_22 | Pneumatics | 3 | 01-10-2004 11:19 |
| A couple of noodle scratchers | Cheese Head | Programming | 11 | 07-12-2002 09:59 |
| Even more interesting numbers: Division of regional winners | archiver | 2001 | 8 | 24-06-2002 03:10 |
| More interesting numbers...specific to big-ball matches | archiver | 2001 | 13 | 24-06-2002 02:51 |