View Single Post
  #7   Spotlight this post!  
Unread 24-02-2004, 16:52
jeremy562 jeremy562 is offline
Engineer
#0562 (SPARK 562)
 
Join Date: Feb 2002
Location: Fitchburg, MA
Posts: 74
jeremy562 is an unknown quantity at this point
Send a message via AIM to jeremy562
Re: Inverting Y axis on joystick

255 is not a valid output on a PWM. I think 3 consecutive 255's result in a reset or something.

The range is 0-254, so you want:

p1_y = 254 - p1_y;

No need for a temp variable, the compiler will handle that just fine.
__________________
SPARK 562: Students Pursuing Applied Robotics Knowledge

2006 BAE Granite State Regional: Finalists with 319 and 176
2006 BAE Granite State Regional: Winners of Motorola Quality Award
2004 BAE Granite State Regional: 7th Seed
2004 Mayhem on the Merrimack Champions! Thanks, 61 and 1289!