View Single Post
  #1   Spotlight this post!  
Unread 27-03-2012, 23:35
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: Check My Autonomous Code

Quote:
Originally Posted by jhellr13 View Post
Just fixed some of the things you commented. I appreciate the comments you had with my logic on somethings, but I kept them the way they were because I am confident that logic works. I added timers and a while loop at the end, though I'm not too sure on that while loop. I didn't change much in the part with the arm because I couldn't quite understand your comment.

To give you more insight of how the arm works, I'll describe it to the best of my ability. It starts straight up, then rotates down to I guess to be something like a 115 degree angle or whatever needed to tilt the bridge on our robot. At that lowest point, there is a limit switch to make the output 0. I am trying to make this autonomous work where when it moves to that sequence, the arm will rotate down at 1, then hit 0 when limit switch is hit. I'm definite the logic is correct as it is also used in my teleop.
Can you post your new code so I can take a look? My comment about the logic is that you have some stuff in there that doesn't do anything, and then some of it that doesn't do anything will cause your motor to keep running indefinitely.

Let me step you through your own logic.

We're looking at this code right here:
Click image for larger version

Name:	Before Cleanup.PNG
Views:	35
Size:	4.1 KB
ID:	12440

Let's clean it up to view everything a little better:
Click image for larger version

Name:	After Cleanup.PNG
Views:	31
Size:	6.5 KB
ID:	12441

Now let's minimize the code, removing code that does nothing.
Step 1:
Click image for larger version

Name:	Minimization 1.PNG
Views:	28
Size:	2.5 KB
ID:	12442

Step 2:
Click image for larger version

Name:	Minimization 2.PNG
Views:	27
Size:	2.7 KB
ID:	12443

Step 3:
Click image for larger version

Name:	Minimization 3.PNG
Views:	20
Size:	1.7 KB
ID:	12444

Please let me know if you do or do not understand this. The reason it all cancels out to a False is because you're using an AND gate, meaning both input X AND input Y must be True in order for the Output to be True.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364
Reply With Quote