View Single Post
  #4   Spotlight this post!  
Unread 02-25-2016, 01:08 PM
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,539
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Controlling motors with spike relays

Your current code doesn't have any way to stop the motor; it needs a final else clause.

Other than that, I don't see the issue in this snippet of code.

The next few things to check:
  • Did you verify that you're getting the values you expect from the GetX()?
  • Is the spike control wire plugged into a relay port (not a PWM or DIO or analog port)?
  • Is relay of the Relay class and initialized to use the same port as the wiring is connected to?
  • Are the wires in the right orientation (both power and control), and are you getting a good connection?
  • Is the fuse on the spike blown?
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote