|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Compressor
Hello, I am from the TeraViks #3145. As of right now, we're stuck. We are stuck on programming the compressor to work. Please help us with any information you have on this predicament. Thanks! Sample:
Code:
#include "WPILib.h"
class RobotDemo : public SimpleRobot {
Compressor *compressorPointer;
public:
RobotDemo() {
compressorPointer = new Compressor(4, 2);
compressorPointer->Start();
}
~RobotDemo() {
delete compressorPointer;
};
};
|
|
#2
|
|||||
|
|||||
|
Re: Compressor
What do you expect to happen? What is happening instead?
|
|
#3
|
|||
|
|||
|
Re: Compressor
It does absolutely nothing. It is supposed to start, and then we'll do further testing.
|
|
#4
|
|||||
|
|||||
|
Re: Compressor
How exactly do you have the compressor and pressure switch wired? Be as detailed as you can.
Does anything work on the robot -- any motors or relays? |
|
#5
|
|||
|
|||
|
Re: Compressor
It does absolutely nothing. It is supposed to start, and then we'll do further testing.
|
|
#6
|
|||
|
|||
|
Re: Compressor
I have no idea why there are two of the same posts, but anyway. They are plugged it to relay 3, digital I/O 4. Everything we tested so far works besides the solenoid and compressor.
Sent from my Nexus 7 |
|
#7
|
|||||
|
|||||
|
Re: Compressor
That's not nearly enough detail for me to give troubleshooting advice. Which individual pins of the Digital Sidecar are connected, and to what? The compressor has two power wires; where do they go?
Pictures would help. |
|
#8
|
|||
|
|||
|
Re: Compressor
Your sample code states the compressor is digital i/o 4, and relay 2, you say you are using relay 3; is that your issue?
Try calling compressor->Start() in your teleop/autonomous loop. The code you presented is fine otherwise, though I would opt to directly instance compressor, rather than allocating it dynamically, but it's a point of preference. I also prefer to derive from IterativeRobot instead of SimpleRobot ![]() Code:
class Robot2012 : public IterativeRobot
{
Compressor compressor;
public:
Robot2012(void):compressor(DIGITAL_CHANNEL_1_INPUT_COMPRESSOR_SWITCH, RELAY_CHANNEL_1_COMPRESSOR_RELAY)
{
}
void DisabledInit(void)
{
compressor.Stop();
}
void AutonomousInit(void)
{
compressor.Start();
}
void TeleopInit(void)
{
compressor.Start();
}
Here's a link to my 2012 code: https://github.com/TeamExcel/Project.../Robot2012.cpp |
|
#9
|
|||
|
|||
|
Re: Compressor
I didn't post the updated code, which has (4, 3) now. Sorry about that. It still won't work either way. To Mr. Anderson, I'll get a picture to you tomorrow.
Thanks, Thys |
|
#10
|
|||
|
|||
|
Re: Compressor
We fixed it. Thanks for trying though.
|
|
#11
|
|||||
|
|||||
|
Re: Compressor
Would you mind telling us what the problem was and what you did to make it work? Others might have similar problems, and your solution might help them.
|
|
#12
|
||||
|
||||
|
Re: Compressor
On behalf of NegaNexus (one of my programmers), thank you to all who helped. This was one of those instances where we had a few different issues that makes troubleshooting extremely difficult and frustrating.
Here's what we found was the cause of our issues: 1. We had a flaky network cable! 2. We had a flaky Windriver install (or some setting was changed that shouldn't have been) Once we got in to a methodical test & record results process, we were able to diagnose the bad network cable. This then led to changing to a different computer with WR and all systems worked as they should. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|