View Single Post
  #7   Spotlight this post!  
Unread 21-09-2003, 11:36
WakeZero WakeZero is offline
FIRST-a-holic Strategist
#1011 (CRUSH)
 
Join Date: Feb 2002
Location: Tucson, AZ
Posts: 316
WakeZero will become famous soon enough
Send a message via AIM to WakeZero Send a message via Yahoo to WakeZero
Quote:
Originally posted by Jeremy J
Well, after a short collaboration with my team's lead programmer, we agree that for the robot, 255 exceeds the max value of what the robot controller can understand. 254 is the max value, I believe. Try changing it to that and then running the program. That should help
Yes, this is the case of a common fencepost error. In most programming languages, including this one, counting starts at zero instead of one. So if you want 10 numbers, it is really 0 through 9, not 1 through 10. So there are 255 values that you can assign a PWM, but it is 0-254
__________________
2004 Arizona Regional -- Semifinalist
2003 NAT Galileo Division -- Highest Seeded Rookie (20th)
2003 NAT Galileo Division -- 100% Autonomous Completion (7 for 7)
2003 Arizona Regional -- Rookie All-Star Award
2003 Arizona Regional -- Quarterfinalist

Alumni on Team 64, The Gila Monsters
College Mentor/Founder of Team 1011, CRUSH