Log in

View Full Version : Compressor programming


Robby Unruh
15-02-2011, 16:01
I'm trying to program our team's compressor. It's hooked up to channel 7 on the IO. I'm doing the bare minimum code of


Compressor compressor = new Compressor(7,1);
compressor.start();


But that doesn't seem to be working. Any tips?

Patrickwhite
15-02-2011, 21:34
Does any of the code work, or does the robot die on starting? If it dies, it is probably an indication that the channels you've listed are incorrect somehow - perhaps not wired right?
Where does this code run - in the initialization method?

Robby Unruh
15-02-2011, 21:55
Does any of the code work, or does the robot die on starting? If it dies, it is probably an indication that the channels you've listed are incorrect somehow - perhaps not wired right?
Where does this code run - in the initialization method?

All of it is done in robotInit and the robot loads up just fine, no errors.

- edit -
actually, our compressor is wired in to PWM 4. Just to clarify, that would be (4,4); correct?

Patrickwhite
15-02-2011, 22:01
Actually, the compressor has two distinct parts to it: the pressure switch (reads the pressure gauge) and the relay (turns the compressor on or off). The constructor for Compressor expects the location of the pressure switch first, and the relay second. Are you sure you're getting both of them in the right place?
Compressor(int pressureSwitchChannel, int compressorRelayChannel)
Compressor constructor.
Compressor(int pressureSwitchSlot, int pressureSwitchChannel, int compresssorRelaySlot, int compressorRelayChannel)
Compressor constructor.

kinganu123
17-02-2011, 23:36
Are you sure you don't have a relay in between the compressor and the dsc and pd board?
Because then you'd need this
Relay relay = new Relay(1);
relay.setDirection(Forward);
relay.set(true);

Robby Unruh
20-02-2011, 15:58
Our spike relay is plugged in to channel 1 on our sidecar on the 'relay' side. In the code I have our compressor programmed like so:


Compressor compressor = new Compressor(4,1);
// as in pressure switch on channel 4, spike relay on relay-1?

I've tried the above relay code- with no luck. Anyone else have any clue what could be wrong?

- EDIT -
False alarm, we moved our relay to PWM 5, and moved some wires. Compressor works beautifully. Thanks everyone.