Logitech NASCAR Wheel / Chicklet Safety Issue?

We’re using the Chicklet with the Logitech NASCAR Steering Wheel. It’s all working great, but we’ve got a small issue that concerns me.

Because the foot pedals return a value of 255 when up and 0 when fully depressed, our code has to account for this in a different way than we would for a normal joystick. In essence, this means that an input of 127 to our code looks like a halfway depressed foot pedal.

That’s all well and good until the Chicklet is unplugged or loses power while the robot is still powered on. If that happens, then the OI outputs a value of 127, the robot thinks we’ve told it to move, and off it goes!

We have a disable switch plugged into our OI Competition port at all times, but we’ve had some cases where the switch wasn’t down when the chicklet was unplugged. And I’m actually more worried about the potential for robot misbehavior at competition. Any comments? Any ideas for how our code could detect a missing Chicklet?

one thing I could think to try would be to use a variable to “save” the value and a counter.

If the value = 127 three times in a row, disable movement until some “non-127” value.

Pseudo code might look a little like this…

if (fwd == 127) or (rev == 127)
{
count++;
}else
{
count = 0;
disable = false;
}

if (count == 3)
{
disable = true;
}

Hope this helps you.

For multiple reasons I suggest subtracting the value of one pedal from the other to get your speed value. Example:

speed = ((int)left_pedal - (int)right_pedal)/2 + 127;

Now speed is like a joystick y-axis. As long as both the pedals are the same value (255, 127 etc) your robot should not move.

Thanks for the responses. Brian, I think you nailed the solution. We’ll be trying out something like that first thing next Thursday (Granite State Regional).

Hope to see you all in Atlanta!