|
Re: How to manipulate a variable value using an array?
When I was trying to write a generalized, modular library for FRC robots (something like WPIlib, but not as high level), I ran into this same issue, but with relay outputs. My solution was to use a structure for storing the values then, at the end of the program loop, call a function that assigned the values in the structure to the actual relays. I think you could do something similar in your case; for example, you could just assign the values of the switches to the various variables in your array at the beginning of every program cycle.
__________________
Team 1219: 2009 - Mentor
Team 587: 2005 - Animator, 2006-2008 - Team Captain
|