View Single Post
  #8   Spotlight this post!  
Unread 17-04-2002, 00:20
Lloyd Burns Lloyd Burns is offline
Registered User
FRC #1246 (Agincourt Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Toronto
Posts: 292
Lloyd Burns is an unknown quantity at this point
Quote:
Originally posted by Joe Ross
I think you would be better off with 255 - x max 254, unless you guarantee that x is never greater then 254 before that.

This will help to keep from outputing two 255's in a row which will reset the data packet and cause all kinds of interesting things to happen.
The guarantee comes from Innovation First's code which will not allow a reading of a joystick or other pot to become more than 254.

254-x works fine, as shown in this table (in monospaced type font):

x value in :...0........127.........254 (max)
254 - x....: 254........127...........0
255 - x....: 255 ** ...128...........1