|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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
|
|||||
|
|||||
|
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
|
||||
|
||||
|
Re: programming axis for motor
C++ would be
Joystick stick(1);//joystick1 stick.GetX(); |
|
#4
|
||||
|
||||
|
Re: programming axis for motor
i am using windriver
thanks i have done ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |