Go to Post Programming humor is funny, period. - 1168Programmer [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 07-01-2008, 21:59
Ryan O's Avatar
Ryan O Ryan O is offline
FRC Eclipse Plug-in Developer
no team (FRC Eclipse)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Plaistow
Posts: 111
Ryan O is an unknown quantity at this point
Send a message via AIM to Ryan O
WPILib Use Help

Okay, so we are just starting WPILib use on our team, and it looks great. However, we are having a couple problems, like how to use some features. I am trying to use the LEDs on the OI (Pwm1_green, for example). I tried using that like I did before, and it didn't work, and I acan't find the function for it. Is there a list of functions and there use out there, because there isn't one in the verison of the papers I got. Also, the SetCompetitionMode function is generateing a warning saying it has no prototype, but I can see it in BuiltIns.h, and API.h is included in that, and BuiltIns.h is included in main. Any help would be great. Here is the basic code I wrote to build off, which aside from the prototype warning compiled clean:

Main.c:

//Include features
#include "BuiltIns.h"
#include "Constants_Control.h"

//Setup competition mode, called first
void IO_Initialization(void)
{
//Set to automatic competition mode handling
SetCompetitionMode(AUTO_FIELD);
}

//Initialize: run at robot startup regradless of mode
void Initialize(void)
{

}

//Note: will switch between auto and operator automatically,
//even if the code is currently in an infinite loop

//Autonomous: run at field control enable
void Autonomous(void)
{
while(INFINITE)
{

}
}

//OperatorControl: Teleoperated period
void OperatorControl(void)
{

}

//Main: Satifies call requiremen only, unused
void main(void)
{

}


My only custom file s far, ConstantsandControl.h:

#ifndef Constants_Control
#define Constants_Control

//Constants
#define AUTO_FIELD 1
#define INFINITE 1

//Controls

#endif


End Code

Any help wuld be greatly appreciated
  #2   Spotlight this post!  
Unread 09-01-2008, 21:50
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 592
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: WPILib Use Help

Ryan -

I tried compiling the code that you listed and didn't get the warning about SetCompetitionMode. What you had seemed right, maybe you were building a Vex version of the program. In the Vex version there are two arguments, the first being the autonomous period time and the second the operator control period.

Actually, that might explain why the SetOILED functions aren't working. Those are also missing from the Vex version since there are no IO LEDs.

Can you verify that you have defined _FRC_BOARD in your project somewhere. That's the preprocessor symbol that includes the FRC stuff.

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #3   Spotlight this post!  
Unread 09-01-2008, 22:16
Ryan O's Avatar
Ryan O Ryan O is offline
FRC Eclipse Plug-in Developer
no team (FRC Eclipse)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Plaistow
Posts: 111
Ryan O is an unknown quantity at this point
Send a message via AIM to Ryan O
Re: WPILib Use Help

It's in the provided headers, but do I need to add a line in user-written code somewhere to tell it which? It never asked anything about that. That would explain it though.
  #4   Spotlight this post!  
Unread 13-01-2008, 11:24
Ryan O's Avatar
Ryan O Ryan O is offline
FRC Eclipse Plug-in Developer
no team (FRC Eclipse)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Plaistow
Posts: 111
Ryan O is an unknown quantity at this point
Send a message via AIM to Ryan O
Re: WPILib Use Help

Ok, got it to work now. I didn't realize you could #define symbols like that outside their headers, and I thought you had to have different syntax. Thanks for the help, problay wouldn't have figured it out until the robot met a wall somewhere
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
Use of printf in WPILib koenig3456 Programming 2 06-03-2006 07:21
could use some programming help. mtaylor Programming 2 23-01-2005 10:54
could use some programming help. mtaylor Technical Discussion 2 23-01-2005 10:54
iF could use some help Nick Mac FIRST-related Organizations 0 12-05-2003 21:26
anyone use an arm to help balance archiver 2001 8 24-06-2002 02:46


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

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