Skip to main content

Reply to "Python code to issue TMCC, Legacy, and PDI Commands"

After writing complicated code to use rotary encoders and potentiometers to control the Lionel Crane Car, Gantry Crane, and Smoke Fluid Loader, I've realized its much simpler to just use a momentary contact switch-based joystick. These devices have just 2 states per position; on and off. They can directly map to Cab-1 RELATIVE SPEED or the Boost/Brake command. Using the gpiozero library, you can code it up so that if the joystick is held "on", the command can be fired repeatedly. I'll send along a video shortly, but this code is much simpler and works much more reliably!! I still allow the use of a rotary encoder to rotate the crane housing, but it also just sends a relative speed command with no acceleration factor. It doesn't look like a cab rotates any faster or slower on the Cab-3, so there isn't a need for complexity.

  -- Dave

×
×
×
×
×