View Single Post
  #5   Spotlight this post!  
Unread 12-01-2005, 13:20
cabbagekid2 cabbagekid2 is offline
Registered User
#0368 (Kika Mana)
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Honolulu, HI
Posts: 85
cabbagekid2 has a spectacular aura aboutcabbagekid2 has a spectacular aura aboutcabbagekid2 has a spectacular aura about
Re: Program for variable speed

Quote:
Originally Posted by Matt Leese
The multiplication by p1_wheel should happen first by order of operations (left-to-right). You could try adding parenthesis around the (p1_wheel)*(p1_y - 127) part and that may fix it. My other thought is that you may be doing 8-bit arithmetic and not 16-bit arithmetic. You might want to move p1_y and p1_wheel into int's first so that it's guaranteed to be 16-bit arithmetic and not 8-bit.

Matt

That was one of our thoughts about the problem....that it was doing the calculation and somehow losing the number. We didn't know how to solve this problem though. Thanks for the suggestion. We'll try creating new 16-bit variables and try this again.