i use easyc
I would recommend robotC over easyC and what I have to say comes from a robotC background, but the concepts are the same either way. The solenoid drivers work as “digital outputs”, somewhat similar to the way touch sensors are “digital inputs”.
For example, if you are checking a touch sensor:
if (SensorValue[touch] == 1){
doStuff;
}
For pneumatics, you are writing, or setting the value, so:
SensorValue[pneumatic] = 1;
would set the solenoid to one direction, 0 is the other. You have to define the solenoid as a “digital output” in robotC. RobotC calls it a sensor but you write to it to set its value.
For interest, i’ve written some pseudo code for toggling a pneumatic off 1 button.
1) Is the controller button pressed?
YES: 2) Was the controller button pressed on the last cycle?
YES: Then the value of the solenoid has already been changed, so do nothing
NO: Then change the value of the solenoid, make note that is has been pressed on this cycle
NO: The button isn't pressed, so do nothing
Note that changing the angle of an intake ramp is still like operating a simple lever, so you have to consider 2 things:
-How far from the pivot point (connection between intake and arm) does the piston connect to the intake?
-How far are the sacks from that same pivot point?
Say the piston connects to the intake at x inches away from the pivot point. A sack that is the same distance from the pivot point will use up 0.5lbs of the piston’s force, since a sack weighs approximately 0.5lbs. A sack that is 2x inches away (twice as far as the piston) from the pivot point will use up twice as much force (1lb) because it has twice as much leverage as the sack that is x inches away.