Thread: Manual Ramping
View Single Post
  #1   Spotlight this post!  
Unread 16-01-2013, 17:15
turtleman turtleman is offline
Captain/ Programmer
AKA: Carlos Jimenez
FRC #4369 (Brick City Bots)
Team Role: Leadership
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Sanford, NC
Posts: 17
turtleman is an unknown quantity at this point
Manual Ramping

I'm not sure if the title really explains what I'm talking about.
Rather than abrupt acceleration and deceleration, my team thought that it would be better if we went in increments, increasing speed on every iteration of the main loop.

I sort of have an idea of the GET functions in the Jaguar, but are there any kind of SET functions that would allow for me to explicitly change the rpm?

This is more or less of my pseudocode as of now, if this helps my rather horrid explanation/request.

Code:
#include "WPILib.h"
int oldX = 0;
CANJaguar::CANJaguar LPort = new CANJaguar::CANJaguar;
CANJaguar::CANJaguar RPort = new CANJaguar::CANJaguar;
global int currentX = Joystick::GetX(PORT);
global double speed = (6 * pi) * CANJaguar::GetSpeed();

while(true)
{
	if(currentX>oldX)
	{
		//Accel
	}
	else if(currentX < oldX)
	{
		//Decel
	}
oldX = currentX;
}
__________________
Cav Pride
Reply With Quote