View Single Post
  #8   Spotlight this post!  
Unread 30-01-2012, 16:35
Team3763 Adam Team3763 Adam is offline
Lead Programmer
FRC #3763 (4H WildCards)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: North Carolina
Posts: 157
Team3763 Adam can only hope to improve
Re: No clue where to start on Programming...

Quote:
Originally Posted by rsisk View Post
You can't go wrong with the resources at WPI either: http://thinktank.wpi.edu/tag/1

The 2 minute lesson:

In Labview, generate a default project for your robot. Be sure to put your team number in for the IP address (10.37.63.2) when you generate the project.

In Project Explorer, Expand the Build Specification thingy, right click on FRC Robot Boot Up Deployment and BUILD, after that finishes, same thing but click RUN AS STARTUP.

If all that succeeds, you now have a robot that will drive with a single joystick and a left and right motor.

To add more functionality, open up BEGIN.VI, press Ctrl-E to get to the block diagram. This is where you connect the programming world of Labview to the physical world of your robot. Check out the definition for the motors and the joystick to see how this is done.

To add other functions, right click in the block diagram to bring up the functions toolbox. Down at the bottom you will see the WPI LIBRARY, this is where most (all?) of the robot related functions are located. You can add motors, joysticks and other stuff here.

The bulk of your programming will take place in TELEOP.VI, this is the LOOP that runs while your robot is in telop mode. Same ideas apply as in BEGIN.VI, except here you will open references to the things you defined in BEGIN.VI, and do stuff with them; read sensors, send signals to motors.

That is the basics, after that, go check out examples, spend time on FRCMASTERY, hook up with other teams and all will be good.
Thank you so much for this help along with everyone else who has provided input. I'm starting to get a "better" hang on programming. However, I have run into yet ANOTHER problem.

While in LabVIEW::

-Went to Robot Main.vi
-Pressed Ctrl+E which opened the Robot Main.iv Block Diagram.
-Double-clicked the Begin.vi and opened up the Begin.vi Front Panel
-Pressed Ctrl+E and opened the Begin.vi Block Diagram.


Now from here I tried 2 different options for adding 2 MORE motors.

Option one:
After opening the Begin.vi Block Diagram I did the following:
-Added another...Pink-ish text box and titled it "Left and Right Motors 2."
-From here I wired up EXACTLY how the first 2 motors were wired up. (Refnum, Drive - Open 2 motors, etc...)
-I COPY and PASTED the 2 PWMs provided on-screen and titled them PWM 3/4.
-With NO ERRORS, I deployed the code onto the cRIO.
-Afterwards, we switched over to the Classmate Driver Station.
-We had Robot Code and Communication, however when moving the joystick, only 2 of the 4 motors spun. (The 2 motors that were already written in the program.
**Option one failed.

Option two:
-Instead of ADDING another "Drive - Open 2 motors," I DELETED the provided Drive - Open 2 motors and REPLACED that with a Drive - Open 4 motors, adding 2 more PWMs, 3 and 4, where the other 2 motors were wired.
-With everything wired correctly and NO ERRORs displayed on screen, we moved over to the Classmate.
-Again, only 2 of the 4 motors were spinning. And again, only the 2 motors that were previously programmed.
**Option 2 Failed.

Right now, we are JUMPING all 4 motors together, but this is causing one motor to stay constant running, while the other 3 react to the position of the joystick.

Any and ALL help reguarding adding 2 more motors to the Begin.vi Block Diagram would be appreciated.

~Team 3763. Adam.
Reply With Quote