3. Usage and Examples

Now you’re ready to start using the library!

To help you get started and familiarize you with the library and the smart train, we created a collection of examples. They will show you how to control the train’s basic functions including movement, speed, navigation on the track, LEDs, etc. You will learn about enabling train event listeners and interactively programming multiple trains. You will also be able to use these examples as seed programs to experiment with your own ideas.

Asynchrounous examples are in the ./examples directory of our repository.

You can read and browse our examples in the repository at: https://github.com/intelino-code/intelino-trainlib-async-py/tree/master/examples

To be able to run it locally and experiment by modifying the code, you can download the whole repository here: https://github.com/intelino-code/intelino-trainlib-async-py/archive/refs/heads/master.zip

3.1. Examples for our synchronous library

If you are interested in sample code for our synchronous (blocking) library called intelino-trainlib (without the async keyword), you can check them out in their separate repository. The synchronous examples are simpler, if you are just starting with Python.

You can read and browse our example repository at: https://github.com/intelino-code/intelino-trainlib-py-examples

To be able to run it locally and experiment by modifying the code, you can download the examples here: https://github.com/intelino-code/intelino-trainlib-py-examples/archive/refs/heads/master.zip