|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools |
Rating:
|
Display Modes |
|
#9
|
||||
|
||||
|
Re: Pneumatics Programming help
Taking a quick look at your code,
You stated that you have your pressure switch connected to digital 3, and your relay (that is then connected to the compressor) connected to relay 2 as well. In this case you have the Compressor instantiation in the wrong order. It should be Compress(3,2). Also as noted by Alan, you have not declared your compressor object. You need to add the line: "Compressor Compress;" somewhere before the constructor... which starts with the lines "public: RobotDemo(void):" I also noticed that you are not calling Compressor.Start() until the OperatorControl function which will not run until the robot is enabled in TeleOp. We generally start that process from our constructor (in your case this could be right after the line "myRobot.SetExpiration(0.1);"). Also, are you getting any error messages displayed on the driverstation or the netconsole? Or is it just not working? Are you seeing a proper value on the digital input? (You can read this using: DigitalModule::GetInstance(1)->GetDIO(3)) and then printing to the netconsole or displaying on the dashboard). If you see the digital correctly then is the relay being set? Do you see the LED next to relay 3 changing from color on the digital side car? Is it also changing on the relay itself? If either of these is not true then it could also be a wiring issue. Hope this helps. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|