View Single Post
  #12   Spotlight this post!  
Unread 07-12-2011, 18:16
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,567
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Using a variable as a class object in Windriver/C++

Quote:
Originally Posted by WizenedEE View Post
Last year, we wanted to program the robot to set all the solenoids on to power the line tracking sensors. We just looped through each of the ports (it was in labview though).
I'm don't really know C++, so I'm not sure if it is accessible, but SolenoidBase has a set which takes a value and mask and writes the whole module at once. For something simple like your use case, I would do something like that (value 0xFF, mask 0xFF).

However, trying to do something like that to for anything less trivial would greatly trade readability and maintainability for compactness, which for FIRST is not something I would try to do.