![]() |
Compressor won't shut off at certain PSI
We just got our compressor working today that's attached with a pressure switch and a relay. Our compressor turns on when we start the robot on teleoperated mode but it doesn't turn off when we reach a PSI of above 125 (factory default).
Our spike is connected up to slot 7 in the relay on the digital sidecar, and our pressure switch is connected to slot 3 on our digital I/O. Everything works fine except that the signal to the pressure switch isn't being received so it's not opening and closing the circuit. We aren't quite sure what the problem is, but here's my code dealing with the compressor, and the relay. tldr;We are able to manually start and stop the compressor with a button on our joystick, but not have it work automatically via the pressure switch. Code:
public class RobotTemplate extends SimpleRobot { |
Re: Compressor won't shut off at certain PSI
Check the javadocs (they can be found under your home directory at sunspotfrcsdk/doc/javadoc/index.html) for the Compressor class. I'm pretty sure the constructor expects the two parameters to be the "pressure switch digital input channel" followed by the "spike relay channel". I think you have them reversed in your code. Try:
Code:
Compressor mainCompressor = new Compressor(3, 7); // DIO, RelayYou might also want to put the state of the pressure switch out to the dashboard periodically so you can confirm that it is working: Code:
public void operatorControl() { Paul |
| All times are GMT -5. The time now is 22:40. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi