Ryan O
07-01-2008, 21:59
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
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