View Single Post
  #1   Spotlight this post!  
Unread 27-01-2013, 21:13
cgmv123's Avatar
cgmv123 cgmv123 is offline
FRC RI/FLL Field Manager
AKA: Max Vrany
FRC #1306 (BadgerBOTS)
Team Role: College Student
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Madison, WI
Posts: 2,082
cgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond repute
Re: Why Can We Not Use CIM motors with Relays? (R52)

Just to show how easy it is, here's Java (and maybe C++, I don't know) code to turn a Victor object victor into a relay based on Joystick object joystick buttons 8 for forward and 7 for reverse (the left buttons on the base of the Attack 3).

Code:
if (joystick.getRawButton(8))
    {victor.set(1.0);}
else if (joystick.getRawButton(7))
    {victor.set(-1.0);}
else
    {victor.set(0.0);}
I'm at home, so I haven't tested this code, but it should be enough to get you started.

Since you're still using a speed controller, you can have it ramp up over a period of time, so you don't have as much of a current rush. You can also have your rate be less than full, or even different rates between forward and backward.
__________________
BadgerBOTS Robotics|@team1306|Facebook: BadgerBOTS
2016 FIRST Championship Tesla Division | 2016 Wisconsin Regional Engineering Inspiration Award

2015 FIRST Championship Carson Division | 2015 Wisconsin Regional Chairman's Award

2013 FIRST Championship Curie Division | 2013 Wisconsin Regional Chairman's Award

2012 FIRST Championship Archimedes Division | 2012 Wisconsin Regional Engineering Inspiration Award, Woodie Flowers Finalist Award (Lead Mentor Ben Senson)