View Single Post
  #4   Spotlight this post!  
Unread 13-02-2013, 09:58
Omar's Avatar
Omar Omar is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Huntsville, AL
Posts: 122
Omar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of light
Re: Shooter Lifting Code

I agree, your code will not work as intended as pointed out above.
Also with the embedded while loop it should not be located in Teleop

Your Distance is a float but you do not have a continuous range from 0 to 60. What will happen if Distance is 15.5 or 24.3 or 38.04 or 44.99999? Does your “distance sense by the vision camera” return? Does it return whole numbers (Blue) or floating point numbers (orange)? see attached code

Also, are there any “dead zones” in between the positions of your touch sensors when your shoots is moving up or down that no sensors will be “TRUE”? That will make it hard to program for.

A Potentiometer would work better for reading absolute position and you could have a variable numbers of shooting position instead of just 5.

But, can you set up your hardware, (the limit switches and your shooter) so that as it move up the next higher limit switch is engaged before the lower one is disengaged (or they could just all stay on as it moves up with you testing for only the highest one)

Give us a better idea on how your hardware works.
Attached Thumbnails
Click image for larger version

Name:	Threshold.png
Views:	37
Size:	4.5 KB
ID:	13966  
__________________
Omar

Last edited by Omar : 13-02-2013 at 10:06. Reason: Added a round down function
Reply With Quote