View Single Post
  #2   Spotlight this post!  
Unread 22-01-2017, 20:21
Adnewhouse's Avatar
Adnewhouse Adnewhouse is offline
Registered User
FRC #0639
Team Role: College Student
 
Join Date: Jun 2013
Rookie Year: 2012
Location: Ithaca, NY
Posts: 21
Adnewhouse is an unknown quantity at this point
Re: CIM coders help!

I think you might want to add parentheses to make it look like this:
Code:
victor->Set((CIM->Get() > 5) ? 0 : 1);
Also, if you want to use encoders and victors on the same ports during teleop, you should create those objects in a single file called RobotMap.cpp and then pass them along to each subsystem, not inside a command. Things can get really messy when you start creating objects inside commands. Have a look at our 2016 kitbot code for how we usually do it (sorry it's really messy, things haven't been cleaned up). Also check out wpilib for more details and best practices for command based code: http://wpilib.screenstepslive.com/s/...ed-programming

Last edited by Adnewhouse : 22-01-2017 at 20:24.
Reply With Quote