Go to Post If the left side of your brain controls the right side of your body then left handers are the only ones in "their right mind". - Al Skierkiewicz [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


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


All times are GMT -5. The time now is 18:23.

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