hsanjuan / dccpi

A simple, easy to use, NMRA Digital Command Control (DCC) Python implementation for Raspberry Pi
GNU General Public License v3.0
54 stars 13 forks source link

Use dccpi to control switches on the rails #9

Closed samFabrice closed 3 years ago

samFabrice commented 3 years ago

Hello I managed to use your library for my project and it works really great. Currently I would like to drive train accessories such as brain motors which control the switches on the rails. except that I may be wrong but I don't see any function in your api that allows me to do this. Can you help me ? thank you

hsanjuan commented 3 years ago

Usually, any other type of device on the tracks is just another DCC-enabled device with an address and functions.

Thus, you can consider your motors/track switches a DCCLocomitive. The way you trigger the switches is using setting the fl, f1-f4 fields (dcc functions) to true/false. That would usually make the decoder power it's wires which would make the track switches open/close. These "Locomotives" do not have speed/direction, just functions...

samFabrice commented 3 years ago

Thank you for your help I will do it and I will keep you informed Best wishes

hsanjuan commented 3 years ago

Thanks, closing in the meantime.