![]() |
FRC Code (Motors, etc...)
Ok, if my memory serves me correctly, the default code uses the PWM01 & PWM08 for motor movement. Is there a way to change this? Also, how do you use PWM's exactly (I was dropped from the programmer's group last year, so most of the stuff left my mind)?
|
Re: FRC Code (Motors, etc...)
Quote:
Code:
/*---------- 1 Joystick Drive ---------------------------------------------- |
Re: FRC Code (Motors, etc...)
Quote:
The RC on the robot has multiple PIN spots, each with their own possible values. So, you can plug any speed controller / relay into any PWM. You have to make sure that you designate it in the code, though. Here's an example: The default code mixes the X and Y values (X = Left/Right, Y = Up/Down) of one joystick on port 1. It then outputs it's values to PWM13, PWM14, PWM15, and PWM16. And another example: Let's say that you want Tank Drive. Obviously, that means that the left motors move the same way and the right move the same way. Use the following code to get tank drive. (By the way, this assumes that you have two joysticks, each hooked up to the OI on ports 1 and 2. Also, make sure that PWMs 1 - 4 are not given values anywhere in your existing code) Code:
pwm01 = pwm02 = p1_y; /* PWMs 1-2 are equal to each other, so put these on the left motors. p1_y means port 1, y-axis. So the left motors are controlled by one joystick when it is pushed forward.*/ |
Re: FRC Code (Motors, etc...)
Thanks to you both :)
I understand now (never quite understood how it all worked). |
| All times are GMT -5. The time now is 00:29. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi