So this is our code, we’re trying to code a double action pneumatic actuator… Down below is a code and further down below pic of my setup… I removed the pressure regulator just to see if it works in this raw format… also no on-off switch needed because I don’t have t-fittings and multiple actuators… Do you think the problem is how I setup the solenoid? When I press the button for the pneumatics the solenoid makes this clicking sound, but nothing is triggering in fact the actuator is automatically extended by itself without the code and it just stays extended like that even when i push it back in…
So as you can see there is a hardware problem… then for the software since its a double action we need to code it to go back to the zero position (unextended) how do you suppose doing that? We just though to use like the wait command or what do you suggest because there might be some better code for double action pneumatic stuff
#pragma config(Motor, port2, backrightMotor, tmotorVex393, openLoop)
#pragma config(Motor, port1, middlerightMotor, tmotorVex393, openLoop)
#pragma config(Motor, port3, frontrightMotor, tmotorVex393, openLoop)
#pragma config(Motor, port6, backleftMotor, tmotorVex393, openLoop)
#pragma config(Motor, port7, middleleftMotor, tmotorVex393, openLoop)
#pragma config(Motor, port10, frontleftMotor, tmotorVex393, openLoop)
#pragma config(Motor, port4, armMotor, tmotorVex393, openLoop)
#pragma config(Motor, port8, rubbermonster, tmotorVex393, openLoop)
#pragma config(Sensor, dgtl6, solenoid, sensorDigitalOut)
task main()
{
while(1 == 1)
{
motor[port2] = -vexRT[Ch2];
motor[port1] = -vexRT[Ch2];
motor[port3] = -vexRT[Ch2];
motor[port6] = vexRT[Ch3];
motor[port7] = vexRT[Ch3];
motor[port10] = vexRT[Ch3];
//telling solenoid to start at the "0" position aka not extended
SensorValue[solenoid] = 0;
if(vexRT[Btn8U] == 1)
{
SensorValue[solenoid] = 1;
}
if(vexRT[Btn6U] == 1)
{
motor[port4] = 127;
}
else
{
motor[port4] = 0;
}
if(vexRT[Btn6D] == 1)
{
motor[port4] = -127;
}
else
{
motor[port4] = 0;
}
if(vexRT[Btn5U] == 1)
{
motor[port8] = 127;
}
if(vexRT[Btn5D] == 1)
{
motor[port8] = -127;
}
}
}