Go to Post Sweeeet swerve drive - Andy Baker [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-02-2009, 15:20
mahmosh's Avatar
mahmosh mahmosh is offline
Registered User
FRC #1946
 
Join Date: Jan 2008
Location: israel
Posts: 125
mahmosh is an unknown quantity at this point
programming axis for motor

our team is working to improve the program so we ask u how to program the axis for jaguar ... and is there -xaxis ?! to use it left or right
  #2   Spotlight this post!  
Unread 23-02-2009, 22:03
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: programming axis for motor

Are you programming using LabVIEW, or are you writing C++ in Workbench? The details differ for each.

[Caution: I am posting without benefit of LabVIEW running on my computer, so I might not get the details exactly right in what follows.]

In LabVIEW, you use a Motor Open VI to specify which PWM output and what kind of speed controller you're using. The output of that VI is a device reference that you feed to a Motor Set VI, and later to a Motor Close. The Motor Set takes a number from -1 to 1 in order to control the motor direction and speed.

Similarly, you use a Joystick Open VI to specify which USB port's joystick you want to read. Its device reference goes to a Joystick Get Axis VI, and later to a Joystick Close. The Joystick Get Axis also takes an input defining which axis you want to use (yes, the X axis is the left-right one), and provides a numeric output from -1 to 1 representing the position of the joystick.

The output of the Joystick Get Axis VI goes to the input of the Motor Set VI.

[Again, caution: I don't have practice with C++ and the WPI library this year, so my description might not get the details here right either.]

Using C++, the ideas are the same, but the implementation is completely different. You instantiate a Motor object, either by setting a Motor *pointer to a new() or by statically declaring a Motor variable, and similarly instantiate a Joystick object. Use Joystick.GetAxis() to read the joystick position, and use Motor.Set() to set the motor speed.
  #3   Spotlight this post!  
Unread 24-02-2009, 06:43
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: programming axis for motor

C++ would be
Joystick stick(1);//joystick1
stick.GetX();
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
  #4   Spotlight this post!  
Unread 24-02-2009, 07:45
mahmosh's Avatar
mahmosh mahmosh is offline
Registered User
FRC #1946
 
Join Date: Jan 2008
Location: israel
Posts: 125
mahmosh is an unknown quantity at this point
Re: programming axis for motor

i am using windriver
thanks i have done
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
programing motor with axis frcchile Programming 1 16-02-2009 08:30
Which axis for accelerometer? bitsoglass NI LabVIEW 1 23-01-2009 17:42
Programming the axis camera...... programmr C/C++ 10 11-01-2009 12:23
Axis Camera Programming in Labview Striker_27 NI LabVIEW 10 09-01-2009 19:19
Getting feedback from Axis Camera?? *programming in C++* Straberrie Programming 3 01-01-2009 22:39


All times are GMT -5. The time now is 03:26.

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