View Single Post
  #10   Spotlight this post!  
Unread 19-12-2008, 16:18
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 744
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: I'm trying not to hate labview but...

Quote:
Originally Posted by Luke Pike View Post
Uh, is it a problem that I've been using the basic framework all along? I saw it as an option, but when I started, I used the basic framework and never tried the advanced. Guess I better take a look at it.

It's funny. I actually find the "advanced" template easier to understand, because all the stuff isn't crammed on one page. The use of sub-vis heps to compartmentalize my understanding of the process.

However, back to SparrowKC's original question...

I think everyone is missing the easy way to do this.

How many wheel's you got? 4 probably.. so start out by changing the "Open 2 Wheels" VI to "Open 4 wheels".
You can do this simply by right clicking on the VI and selecting "Replace".
Go ahead and specify the other 2 PWM channels and wheel directions.

OK, now your device reference cluster holds references for 4 wheels.

You want to roll your own drive code.... no problem. Just don't use the standard Drive VIs.
You can access the refs in the cluster and do your own motor control.... how?
Just look inside the canned drive VI's (eg: Drive:ArcadeDrive) by double clicking them, and pulling up the Block Diagrams.
There's lots of flexibility built into them, so you may have to go a couple of levels deep to see the basic wheel control code, but a really good sample is found in RobotDrive:Motors.vi

Basically you use Drive:GetPwmRef, and then pass the ref to Motor:SetSpeed.

Now you have total freedom to roll your own code, with very little hacking of existing globals.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor

Last edited by PhilBot : 19-12-2008 at 16:21.
Reply With Quote