hello,
we are facing trouble with the pressureswitch it simply won’t work the Compressor just keeps on going forever!!!:ahh:
we have connected the Compressor to a functional spike and connected
the spike with pwm to the “relay” side car
also we connected the pressureswitch to the "digital I/O " part of the sidecar!!
(( the pwm cord are working the black cord in place and the red cord not connected with the signal cord in place))
our pneumatics is fully functional we tested it before connecting it with our robot!!
we are using wind river c++
and this is our code for starting the compressor
#include "WPILib.h"
#define GRAY_AREA 0.06 //The area that human hand may commit an error in .
#define MIN_SPEED 0.1 //the min speed that the wheels may get while turning.
#define INVERT -1 //invertieng a positive value to a neg value.
#define ANGLE2SPEED 0.06 // to convert Gyro angles to motor speed since angle is -30 to 30 and speed from -1 to 1
#define MAXSPEEDGYRO 0.7 // max speed in gyro mood before inverting correction from left to right
#define MAX 1 //MAX speed for the elec shooter.
#include "Gyro.h"
#include "Joystick.h"
#include "Compressor.h"
#include "DriverStation.h"
#include "PWM.h"
#include "Solenoid.h"
#include "Jaguar.h"
#include "Victor.h"
/**
* This is a demo program showing the use of the RobotBase class.
* The SimpleRobot class is the base of a robot application that will automatically call your
* Autonomous and OperatorControl methods at the right time as controlled by the switches on
* the driver station or the field controls.
*/
class RobotDemo : public SimpleRobot
{
//RobotDrive myRobot; // robot drive system
//Joystick stick; // only joystick
Jaguar FL;//FrontLeft motor.
Jaguar FR;//FrontRight motor.
Jaguar RL;//RearLeft motor.
Jaguar RR;//RearRight motor.
RobotDrive myRobot; // Robot drive system
Joystick Rightstick; // driving joystick
Joystick Leftstick; // shooter+hangr stick
float rSpeed,lSpeed;
float spinspeed;
Compressor mycomp;//c
Solenoid gripper_o;
Solenoid gripper_c;
Victor spin;
public:
RobotDemo(void):
//myRobot(1, 2), // these must be initialized in the same order
//stick(1) // as they are declared above.
FL(1),FR(2),RL(3),RR(4),
myRobot(&FL, &FR,&RL,&RR), // These must be initialized in the same order.
Rightstick(1),
Leftstick(2),
mycomp(2,2),
gripper_o(8,2),
gripper_c(8,3),
spin(5)
{
myRobot.SetExpiration(0.1);
mycomp.Start();
}
However, every time we try to start the robot the compressor doesn’t stop and the pressure switch regulator stops at 90 psi??
We are really confused
!