View Single Post
  #2   Spotlight this post!  
Unread 06-02-2013, 22:41
toastnbacon toastnbacon is offline
Registered User
AKA: James
FRC #3169 (Saintborgs)
Team Role: College Student
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Edmond
Posts: 97
toastnbacon is a jewel in the roughtoastnbacon is a jewel in the roughtoastnbacon is a jewel in the roughtoastnbacon is a jewel in the rough
Re: Connecting an FRC Dashboard project to an FRC cRio project

I don't know if this is the most elegant solution out there, but it should work. I also don't know how much you or the people from the future reading this know about programming, so I'll go ahead and explain it. What this will do is look at the analog input 1 slider. It divides it up into four sections (0-1, 1-2, 2-3, 3-5) and will build an array consisting of the Boolean values of if the slider falls in each of these sections. For example, a value of 1.5 would be read as [False, True, False, False]. It then searches for which value in the array is true (at any given point there will only be one true value) and takes the index (0, 1, 2, or 3) of it. This index is then plugged into a case structure (expanded for your viewing pleasure). If it's 0-1, case 0 will run. If it's 1-2, case 1 will run, etc.
Attached Thumbnails
Click image for larger version

Name:	For Deviator247.png
Views:	43
Size:	217.8 KB
ID:	13834  
Attached Files
File Type: vi Prog For Deviator247.vi (7.9 KB, 2 views)
__________________
"This must be what going insane feels like."-Simon Tam, Firefly