![]() |
solenoid problems
I need help with Programming the solenoid to a the trigger button on our controller it will be on the kicker joystick.
Code:
package edu.wpi.first.wpilibj.templates;help will be much appreciated. |
Re: solenoid problems
What's the point of this:
Code:
if (fluffy.getPressureSwitchValue()) {Code:
if (System.currentTimeMillis() - lastFired >= 2000) { |
Re: solenoid problems
if (fluffy.getPressureSwitchValue()) {
fluffy.setRelayValue(edu.wpi.first.wpilibj. Relay.Value.kOff); } else { fluffy.setRelayValue(edu.wpi.first.wpilibj. Relay.Value.kOn); } this will i believe to turn off the compressor (have not yet tried it yet) also is the only import we need is import edu.wpi.first.wpilibj.solenoid; right thanks. |
Re: solenoid problems
How can I implement that into my code.
|
Re: solenoid problems
Quote:
From what my team assumed, the compressor automatically turns on/off, depending on the pressure switch. We initially couldn't get it to work, but it turned out to just be a bad spike. So I'm not really sure if you need to be turning it on/off. As for the solenoid, yes all you need to import is Code:
import edu.wpi.first.spilibj.Solenoid;Hope that helped. |
Re: solenoid problems
After you import the solenoid class, you will have to create your solenoid objects in Java. You can do this using :
Solenoid kicker = new Solenoid ( slot, channel ); then in your program, you can check the status of the trigger using an "if" selection and use the set( boolean on ); method to turn the solenoid on. |
Re: solenoid problems
Quote:
|
Re: solenoid problems
Code:
Solenoid kicker = new Solenoid ( 7, 1 ); //locate a solenoid on slot 7 of cRio and channel 1 on the solenoid breakout. |
| All times are GMT -5. The time now is 09:26. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi