View Single Post
  #6   Spotlight this post!  
Unread 30-05-2007, 21:29
IraJason IraJason is offline
In Search of "Bang Head Here" Sign
AKA: Ira Goldberg
FRC #3632 (D-Tecs); FRC #1712 (Dawgma)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2005
Location: Lower Merion, PA
Posts: 283
IraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant futureIraJason has a brilliant future
Send a message via AIM to IraJason Send a message via MSN to IraJason
Re: Single Click On/Off Using the Trigger in EasyC

Quote:
Originally Posted by lukevanoort View Post
I dunno if this is causing the problem, but I'd put in a little time delay before it can switch states, because, as coded, if you held the trigger down too long the system would 'flicker' between the two states.

I have no experience with WPIlib, so I do not know if this could be the issue, but you don't set the relay to zero in your second if statement, so I would think it might just stay at that value set earlier. Again, I have no experience with WPIlib, so I don't know if this could be the issue.
I was thinking that was the problem, as I tried using a counter for every button press and it still didn't work all the time. I'll try putting in a little bit of a time delay during the second if statement and see what happens.

I also tried setting the relay to zero in the second statement, and the results were not too good. I don't remember the exact response though. This current code does work, but I am missing a step in turning it back off. It does turn off on some presses, but sometimes it does not for a few or many clicks.
__________________
Many respectable physicists said that they weren't going to stand for this - partly because it was a debasement of science, but mostly because they didn't get invited to those sort of parties."
-Douglas Adams The Hitchhiker's Guide to the Galaxy

2007 Galileo #6 seed, 5th Alliance Captain, Semi-finalist
2007 Philly Regional #4 Seed, Philly Regional GM Industrial Design Award Winner
2006 Philly Regional Highest Rookie Seed,Philly Regional Rookie All Star