coding problem!! HELP!

Isn’t p1_sw_aux1 and p1_sw_aux2 the two buttons on the joy stick under the joy stick wheel?

But then why doesn’t our code work?

We are using a double solenoid valve to control a cylinder; relay 1 (a spike) is connected to one end of the valve and relay 2(another spike) is connected to the other end of the valve (right? :confused: )

So the code goes:

relay1_fwd = p1_sw_aux1;
relay1_rev = 0;
relay2_fwd = p1_sw_aux2;
relay2_rev = 0;

The problem is that the spikes were orange while the circuit breaker was green. The pressure was all right for the cylinder to move (manually) but the joy stick control didn’t seem to work at all…

What’s wrong guys? NEED HELP!!! :frowning:

Check your spike…make sure its working. Dig out a DMM and check continuity through the circuit from the breaker all the way to the solenoid
(with the robot powered off). Also, check to make sure your PWM cable is attached to the spike…those things can be a pain in the neck.

If your software compiled correctly it really shouldn’t be a software error, its more likely to be a wiring issue

Just something to try if you get time or for future reference:
…also if you are just using a single double solenoid you can make life a lot easier and your robot lighter by using a single solenoid.

Tie both commons to a common ground point on your control panel, and then tie the positive lead from the side which causes the spike to shoot out to M+ and the red positive lead on the side that causes it to shoot in to M-.

then hook a single PWM cable up to PWM 1 and change your code to this:

relay1_fwd = p1_sw_aux1;
relay1_rev = p1_sw_aux2;

Thanks for replying.

But the problem is…the buttons on the joy sticks don’t work at all! I receive absolutely no feedback from those buttons…and I’m very sure that those buttons were aliased and loaded (since they were in ifi_aliases)

Does your buttons work? It’s messing my mind up! :frowning:

check the PWM cable and make sure it is properly attached and then check the spike…it should react…

Then again, not to insult or offend you, but is the joystick plugged into port 1?

If all of those are ok, my guess is that you have a bad spike

Not only that the pneumatics doesn’t respond to the buttons, the printf command didn’t even receive a signal from the buttons (although the analog mapping works)

So I have only one last deduction, either our joysticks are broken (all four of them?) or our RC is broken or our User Interface is broken (we’re screwed)

Is there any other possibility?

Before you decide that the joysticks are shot check the pin outs of the joystick analog1 and 2 switches using a DMM and run a continuity test

First test put the red lead on pin 10 and the black lead on pin 12, then push the button aux 1 button…if you have continuity, the switch works

Test 2, keep the black lead on pin 12 and put the red lead on pin 14. Push aux 2 and see if you have continuity.

Without the power connected to the joystick, how can i test the circuit?

The joysticks only need +5v for each analog axis. The buttons connect the pin for the button to ground.