View Single Post
  #2   Spotlight this post!  
Unread 19-02-2012, 19:18
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Limit Switch to control Spike

The flicker is a clear sign that you're trying to control the Spike in more than one place, and they're contradicting each other. That's exactly what I see in your code, where you're setting the Spike based on the button presses and then using the limit switches after the fact to turn the Spike back off.

I suggest instead that you use the first limit switch to interrupt the signal from Button 6, and use limit switch 2 to interrupt the signal from Button 7. Do that by inverting the output of the DIO Get then ANDing the result with the button's value before wiring it to the Select node. The extra cases that turn off the Spike should be removed. That way you'll be setting the Spike's state in only one place.
Reply With Quote