Skip to content

mathemagie/lego_train_vert_rouge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Train Control

This code controls a train motor using a PoweredUpHub and a speed value read from a file. The motor speed is updated whenever the value in the file changes.

Installation

To run this code, you will need to install the curio, bricknil, and bricknil_sensor packages. You can do this using pip:

pip install curio bricknil bricknil_sensor
python train.py

Launch WebAPI for the train

python server.py

To use the api_train API, you can make HTTP GET requests to the following URLs:

To use these APIs, you can open a web browser or use a tool like curl to make the HTTP requests. For example:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages