How to automate LEGO trains using original LEGO pieces (and Python)

Поділитися
Вставка
  • Опубліковано 22 чер 2024
  • In this video I show how to use PyBricks to program a train and a train car to use a sensor for automation. Hub-to-hub communication using Bluetooth is used to tell the cars when to open their doors.
    LEGO Train used in this video: www.lego.com/en-us/product/ex...
    Sensors:
    www.bricklink.com/v2/catalog/...{%22iconly%22:0}
    and
    www.bricklink.com/v2/catalog/...
    Project for the code: github.com/LasseD/PybricksPro...
    The code is written using PyBricks: code.pybricks.com/
    Chapters:
    0:00 Speed Building
    1:36 Show the standard functionality
    2:06 Build in a sensor
    2:30 Remove the lights
    2:36 Colors to detect
    2:45 Code for color detection
    3:00 Color detection
    3:11 Code color sensing
    3:18 Which colors are uniquely detected?
    3:24 Use colors to command the train
    3:44 Slow and fast driving
    4:02 Stop at a station
    4:46 Expand the station
    5:05 Motorize the doors
    6:10 Code the hub-to-hub communication
    6:18 Code for the train car doors
    6:48 Failed test due to non-ending broadcast
    7:21 Mechanical fix (swap a motor)
    7:34 Code fix to halt broadcast signal for doors
    7:50 Testing
    8:48 Expand the track
    9:17 Failed test for reversing
    9:38 Reversing is added to outer track
    9:44 Fail due to cable having too little space between cars
    9:57 Fix of car buffers
    10:04 Final testing of all features
  • Наука та технологія

КОМЕНТАРІ • 15

  • @Snuggles_the_Unholy
    @Snuggles_the_Unholy Місяць тому +6

    For me, the most satisfying thing about these builds is that lego-snap. It has a nice ASMR feel.

  • @mattimotion
    @mattimotion Місяць тому +2

    I love how neatly you hid the electronics!

  • @pedro380085
    @pedro380085 6 днів тому +1

    great video with the debugging!

  • @hivecitycorpgovCommand
    @hivecitycorpgovCommand 4 дні тому

    3:20 This makes it more tricky. This is why h Corp trains are best.
    Because they are not controlled by machines.
    They are controlled by people.Instead of machines.

  • @pybricks
    @pybricks Місяць тому +1

    Great video! Nice combination of block-based coding and Python coding :)

  • @TuneStunnaMusic
    @TuneStunnaMusic Місяць тому

    Im surprised the switch wasnt automated, pretty cool though

  • @legomitroman
    @legomitroman Місяць тому

    👍

  • @RohanBeckett
    @RohanBeckett Місяць тому

    awesome work - however I can't see the code on your github?

    • @LasseDeleuran
      @LasseDeleuran  Місяць тому +1

      Thanks. I missed a commit. It has been added now.

    • @RohanBeckett
      @RohanBeckett Місяць тому

      @@LasseDeleuran thanks for that! I'm working and learning both text and blocks coding - are you able to share the screenshot from your blocks code too?

  • @user-kw7vw4ow2n
    @user-kw7vw4ow2n Місяць тому

    Сюда бы CaDa микромоторы для открывания дверей

  • @hivecitycorpgovCommand
    @hivecitycorpgovCommand 4 дні тому

    7:39 Too complicated for a simple command.

  • @mau92836
    @mau92836 28 днів тому

    いいね!

  • @user-zh2fe8dy7x
    @user-zh2fe8dy7x Місяць тому

    Я люблю механизмы