![]() |
Take a quick look at our code?
I won't be able to get to our robot again until ship day. I'd like to be able to walk in on Tuesday and deploy a working program.
This is our first time programming in C++ so we would appreciate any pointers (no pun intended). What we need: Tank drive Compressor Solenoids controlling 2 actuators Here's what I have: Code:
#include "WPILib.h"It compiles, so that is a start. Thanks for your help! |
Re: Take a quick look at our code?
I don't have much experience with the pneumatics, so I'll let someone else help out with that.
One thing I noticed is that the "IsEnabled()" part of your while loop is redundant (I'm pretty sure). It's my understanding that the program shuts down all outputs when it's disabled, so even though it might run that code, it won't actually move the motors or solenoids. As far as I can tell, you're drive and joysticks seem right. |
Re: Take a quick look at our code?
To use the compressor, you must first declare it in the .h file in the inout interface using Compressor name where name is whatever you want to name the compressor in the code. Then, you set it up in the .cpp file by putting in these two values like this: name(x, y). x is the spike channel and y is the pressure regulator channel. If you have already done all this correctly, then the only other thing to check is if moving compress.Start() to the OperatorControl method right here will work
Code:
void OperatorControl(void) |
Re: Take a quick look at our code?
Quote:
Code:
if (rstick.GetRawButton(1)){ |
| All times are GMT -5. The time now is 13:07. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi