Go to Post Well, there goes my strategy of blowing out the opponent and then committing flagrant safety and sportsmanship violations to keep the margin close :D - Jared Russell [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 03-03-2012, 18:04
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,754
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Driving based on range?

To answer the direct question, no. You do not need to worry about feeding motors more than one zero. The safety will kick in and set them to zero as well, but there is no harm and no need.

But. I looked at your code, and it doesn't do what you describe.

The loop that reads the ultrasound will not exit until the value from it is greater than 39.75 units -- not sure what the units are. Then it will start the motors at .65 and will no longer read the ultrasonic. I suspect that the initial state of the motors is zero, so the robot may not move at all.

Remember that data doesn't leave a loop via a wire until the loop finishes, and if you want two loops to run in parallel, you can't have wires between them.

I attached a picture of some code for comparison that looks at the ultrasonic and sets the motors to either 0.65 or 0.0, and stops the loop when the limit is reached. The sequence says that the other stuff starts only after the loop is complete.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2012-03-03 at 5.02.41 PM.png
Views:	28
Size:	13.1 KB
ID:	12184  
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 22:15.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi