|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|
Re: Compressor works in teleop but not autonomous?
compressor.start() won't start the compressor every time you call it.
It is designed to be called once for every time you stop it. (it defaults to off) When you call start, a semaphore is set to true. This flag is checked twice a second by another thread, and if enabled (from the semaphore) and enabled (from the driver station) and the pressure switch pulls the IO pin to ground it sets the compressor's spike to turn on forward. The line Code:
c->Enabled() This is the thread that turns on and off the compressor (In C++, the Java version is very similar): Code:
static void compressorChecker(Compressor *c)
{
while (1)
{
if (c->Enabled())
{
c->SetRelayValue( c->GetPressureSwitchValue() == 0 ? Relay::kOn : Relay::kOff );
}
else
{
c->SetRelayValue(Relay::kOff);
}
Wait(0.5);
}
}
You only need to call start once in the program. |
|
#2
|
||||
|
||||
|
Re: Compressor works in teleop but not autonomous?
Hi,
@biojae: We know that compressor.start(); is meant to be called once. The problem is, it doesn't do anything (even with pressure at zero). In other words, it's not starting even when it should (and again, the compressor works in teleop without an issue). @buildmaster5000: We're using SimpleRobotTemplate, so we don't have robotInit(). We'll try robotMain() and see what it does. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Updated LabVIEW and Compressor no longer works | HansJ | NI LabVIEW | 1 | 18-02-2010 10:00 |
| Camera tracking code not working in our own program, but works in CircleTrackerDemo | TPNigl | Programming | 3 | 31-01-2010 19:40 |
| Labview Autonomous AND Teleop | Two-Face | Programming | 1 | 14-02-2009 18:33 |
| Cam works but RC won't | LightWaves1636 | Programming | 9 | 03-02-2006 13:15 |
| New to C but not to basic, need help on autonomous | cdennisxlx2 | Programming | 4 | 02-02-2005 03:38 |