ROBOTC.net forums
http://robotc.net/forums/

vex double soleniod program help
http://robotc.net/forums/viewtopic.php?f=11&t=2973
Page 1 of 1

Author:  mitch j [ Mon Jan 31, 2011 11:58 pm ]
Post subject:  vex double soleniod program help

Could someone please check my code and tell me why it only works one valve and not the other? I assume that there needs to be a +/- signal sent from digital 7 for the 2 valves. we have the cortex and newest robotc

Code:
#pragma config(Sensor, dgtl7,  soleniod1,           sensorDigitalOut)
#pragma config(Sensor, dgtl8,  soleniod2,           sensorDigitalOut)
#pragma config(Sensor, dgtl9,  solenoid3,           sensorDigitalOut)
#pragma config(Motor,  port2,           right,         tmotorNormal, openLoop)
#pragma config(Motor,  port3,           left,          tmotorNormal, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main ()
{
while(true)                   // Loop Forever

if(vexRT[Btn6U] == 1)           // If button 6U (upper right shoulder button) is pressed:
{
SensorValue[soleniod1] = 1;  // …activate the solenoid.
}
else // If button 6 (upper right shoulder button) is  NOT pressed:
{
SensorValue[soleniod1] = 0;  // ..deactivate the solenoid.
}

if(vexRT[Btn6D] == 1)           // If button 6U (upper right shoulder button) is pressed:
{
SensorValue[soleniod1] = -1;  // …activate the solenoid.
}
else // If button 6 (upper right shoulder button) is  NOT pressed:
{
SensorValue[soleniod1] = 0;  // ..deactivate the solenoid.
}

}

Author:  mightor [ Tue Feb 01, 2011 2:07 am ]
Post subject:  Re: vex double soleniod program help

In both sections you are activating solenoid1. Is it supposed to activate solenoid2 or 3?

- Xander

Author:  jbflot [ Tue Feb 01, 2011 10:15 am ]
Post subject:  Re: vex double soleniod program help

Yes, it looks like you're trying to control the same physical solenoid in both pieces of code. Also, since solenoids are digital outs, you only ever have to give them values of 1 or 0 (no negatives).

Author:  mitch j [ Tue Feb 01, 2011 11:17 am ]
Post subject:  Re: vex double soleniod program help

There is no other way to connect a double seloniod. It is a 3 wire that only goes in one digital slot. The documentation is non existant. I guess I will look for the soleniod on line but I can not imaginge a way to activate both valves with out +/-. the digital can do negatives with the motors. Do I need to assign a motor to the port and through code limit it to 5 volts?
thanks

Author:  mitch j [ Tue Feb 01, 2011 11:58 am ]
Post subject:  Re: vex double soleniod program help

http://www.coastpneumatics.com/american ... valves.pdf
shows the syj3120 as definately +/- voltage controled by diodes.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/