View Single Post
  #7   Spotlight this post!  
Unread 08-02-2013, 17:10
bvisness's Avatar
bvisness bvisness is offline
Programming Mentor, Former Driver
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Woodbury, MN
Posts: 181
bvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of light
Re: How to program a limit switch?

First off, I don't really see how you could ever get a value of less than 0 when you modify the throttle input like that. If I'm understanding correctly, the code you wrote would scale the throttle value from 0 to 1.

Regardless, though, I would use another Select to choose your output rather than a case structure. I've attached a screenshot explaining (very roughly) how I would structure this.
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	53
Size:	4.5 KB
ID:	13860  
Reply With Quote