![]() |
Noob Programmer question about coding a PSI Sensor
Hey everybody! Our team is using pneumatics this year and we don't know how to code a pressure sensor (pressure transducer). We thought that asking you guys how to would be better than hours on google. We appreciate any form of help. Thank you in advance!
|
Re: Noob Programmer question about coding a PSI Sensor
Quote:
Code:
import edu.wpi.first.wpilibj.AnalogInput; |
If you use the PCM right, you never have to write any code. There should be a spot for your pressure sensor, and one for your compressor (and a bunch for your solenoids, but you have to get there first :) ). Once you call Compressor.start() (or your languages local equivalent), the PCM will send power to the compressor until your pressure sensor reads as a full 120psi wherever it is in your pneumatic loop, and then shut off. It will automatically turn on the compressor once it dips below 120 again.
|
Re: Noob Programmer question about coding a PSI Sensor
To clarify, if your using an on/off pressure sensor to control the compressor, you need wazateer1's response. If you are going to install an analog sensor for which the voltage varies with pressure and read it through an analog input, you need kmodos is doing. His is in C++, you didn't state what language you are using.
|
Re: Noob Programmer question about coding a PSI Sensor
Quote:
|
Re: Noob Programmer question about coding a PSI Sensor
The question we MEANT to ask, is how would we read the psi of the pressure sensor in the dashboard? we understand that the sensor works automatically Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!
|
Re: Noob Programmer question about coding a PSI Sensor
The sensor is a digital input. You get on/off, not an analog pressure. You need a separate analog sensor if you want pressure
|
Re: Noob Programmer question about coding a PSI Sensor
If you are looking for a decent sensor, this is the one we are using on our robot and will work with the code I posted above with no modification.
|
Re: Noob Programmer question about coding a PSI Sensor
Hey! Kmodos, how do you get the information from the sensor, into the driverstation? any idea or is it in the code and were just stupid?
|
Re: Noob Programmer question about coding a PSI Sensor
Quote:
|
| All times are GMT -5. The time now is 08:59 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi