How to make smart Lego Train layouts

Ғылым және технология

Running Pybricks on the City Hub has a lot of advantages. Your code runs and stays on the hub, so you don't need your phone all the time. And you can make it detect colors on the track without missing anything. In this video tutorial we show you how.
Try it out via pybricks.com/

Пікірлер: 45

  • @emanym3909
    @emanym39096 ай бұрын

    Thanks for doing what TLC is not doing for their own app!

  • @Sergeichxenon
    @Sergeichxenon6 ай бұрын

    Awesome step by step programming explaination. Thank you! Looking forward for track switches programming:)

  • @BatteryPoweredBricks
    @BatteryPoweredBricks6 ай бұрын

    Fantastic work on the block coding and on the guide!

  • @pybricks

    @pybricks

    6 ай бұрын

    Thank you! We're not quite up there with proper video creators like you, but we're trying and learning. New mic on the way 😁. We're super excited to finally release this feature. We hope this will make it even more accessible for non-coders. More train videos coming up!

  • @BatteryPoweredBricks

    @BatteryPoweredBricks

    6 ай бұрын

    @@pybricks I've been using a $30 lav mic and primarily my phone for recording video for years, I've been due for an upgrade for a while 😅

  • @jacobroebuck5648
    @jacobroebuck56487 ай бұрын

    Awesome! Thanks!

  • @TimmeyTV
    @TimmeyTV4 ай бұрын

    I also used PyBricks to program my motorized tram. It was very difficult to distinguish tan from yellow or red from reddish brown :D However, I didn't have a "best match" function back then. So it was very hard to distinguish all these colors.

  • @JohnTrasher
    @JohnTrasher6 ай бұрын

    Great... i bought spike essential for my kids, but also spike prime for me. Do you have an overview what parts synergize with pybricks? Can i also use buwizz or cada parts? Or only lego motors/battery Packs?

  • @pybricks

    @pybricks

    6 ай бұрын

    All official parts from Spike Prime, Spike Essential, Powered Up, Boost, and recent technic sets work seamlessly together. You can even use them together in one large build. You can browse around the documentation to see all devices and available blocks: docs.pybricks.com/en/latest/

  • @JohnTrasher

    @JohnTrasher

    6 ай бұрын

    @@pybricks the link shows a 404 page? I think i will stick to prime blocks though they are so expensive. During christmas holudays i gonna join you as a patreon :)

  • @pybricks

    @pybricks

    6 ай бұрын

    @@JohnTrasher thanks, looking forward to seeing you there! The link works for me, but I'll keep an eye out for it today.

  • @Tekytek
    @Tekytek6 ай бұрын

    Great video, I currently use PyBricks for my trains, but manually program the hubs, the block method looks cool. Do you have a schematic for building the switch point please? Your version looks compact to what I’m currently using 😃

  • @pybricks

    @pybricks

    6 ай бұрын

    Yes! Making instructions for the switch is on our to-do list. It's a frequent request 😀

  • @Tekytek

    @Tekytek

    6 ай бұрын

    @@pybricks Great. 😎

  • @mikhailglukhov6680
    @mikhailglukhov66807 ай бұрын

    Can the blocks be automatically be converted into Python code if needed? For example, I start making the program using blocks, and then decide I want to continue to edit it using Python.

  • @pybricks

    @pybricks

    7 ай бұрын

    Yes! You can even see it change live as you move blocks around. See a demo here: kzread.info/dash/bejne/qY6Xk8uxYJPJirw.html

  • @Monkey909
    @Monkey9097 ай бұрын

    Hello, would it be possible to use a NXT with Pybricks? I really like python block coding as I am used to it from Spike prime education. Thanks!

  • @pybricks

    @pybricks

    7 ай бұрын

    Possible in theory, at least the brick is powerful enough. Right now we're focusing on the current hubs. But with enough supporters, we may be able to support NXT and EV3 as well at some point. =)

  • @Monkey909

    @Monkey909

    7 ай бұрын

    @@pybricks OK, thanks for responding. I would love to see it as the software supporting NXT are all pretty outdated. :D

  • @pybricks

    @pybricks

    7 ай бұрын

    @@Monkey909 Completely agreed! I'd say tell LEGO you'd like to see Pybricks support for NXT and EV3. With their support we can make it happen :)

  • @CastleWolf17
    @CastleWolf175 ай бұрын

    Hi, can you run multiple trains at once with motorized switches, etc, to automate a huge layout completely with Pybricks? Or can you only program/run one train hub at once?

  • @pybricks

    @pybricks

    5 ай бұрын

    Sure you can! Once a program is saved on the hub you can run it again without a connection. Just press the green button. So at that point they run all by themselves and you can move onto the next... But yes, you can even code multiple at the very same time.

  • @CastleWolf17

    @CastleWolf17

    5 ай бұрын

    @@pybricks So you can run multiple hubs at the same time in the same program, correct?

  • @pybricks

    @pybricks

    5 ай бұрын

    @@CastleWolf17Each hub runs its own separate program. But you can send messages between the two. We have a video tutorial for that too :)

  • @CastleWolf17

    @CastleWolf17

    5 ай бұрын

    @@pybricks Oh,ok, sounds great, thanks! Your program is awesome and much better than LEGO's own powered up app lol

  • @Watchdogl7
    @Watchdogl76 ай бұрын

    Do you have a block code for the automatic switch ? Maybe on a website or forum somewhere.

  • @pybricks

    @pybricks

    6 ай бұрын

    The one in the video works like this: wait for train detection (a low distance measurement), then turn the switch. Then wait for the train to pass (wait for large distance measurement).

  • @fugatechlego
    @fugatechlego6 ай бұрын

    Ok been trying this out today. The motor either just goes back and forth very quickly or just passes the color that I created.

  • @pybricks

    @pybricks

    6 ай бұрын

    Happy to help - this is a good place to ask: github.com/orgs/pybricks/discussions

  • @pybricks

    @pybricks

    6 ай бұрын

    Just a thought, did you also add the colors of the track sleepers and background as in the video?

  • @bencarney

    @bencarney

    5 ай бұрын

    Plus 1 to this - it has no trouble recognizing the colors (I make it print them also) but drives straight past them. I have the track and background added

  • @bencarney

    @bencarney

    5 ай бұрын

    I put the motor blocks inside individual tasks, and then put the tasks in and it worked

  • @pybricks

    @pybricks

    5 ай бұрын

    @@bencarney The best way to get help is to share a screenshot of your code in the forum link above. Thanks!

  • @paulharris4256
    @paulharris42565 ай бұрын

    Can I use an Apple computer to do all this or must I have a windows computer?

  • @pybricks

    @pybricks

    5 ай бұрын

    Yes, Mac/Windows/Linux/Android are all supported!

  • @paulharris4256

    @paulharris4256

    5 ай бұрын

    @@pybricks what browser do I need to use?

  • @paulharris4256

    @paulharris4256

    5 ай бұрын

    @@pybricks Also; what about Raspberry Pi?

  • @pybricks

    @pybricks

    5 ай бұрын

    @@paulharris4256Chrome, Edge, or any other browser that supports Bluetooth. note that you can try out everything for free, so just give it a go - See the website for this :)

  • @pybricks

    @pybricks

    5 ай бұрын

    @@paulharris4256 on raspberry pi, Chrome should be available as well. Chromium is a good open source variant.

  • @fugatechlego
    @fugatechlego6 ай бұрын

    Code blocks is paid only?

  • @pybricks

    @pybricks

    6 ай бұрын

    Yes - Using blocks is a great way to support the whole Pybricks project, including Python coding which remains open source and free :)

  • @KevinVanDenHaute
    @KevinVanDenHaute5 ай бұрын

    Nice, but a lot of limitations. No port over for lights, multi-trains on a track, .. but good for the kids to get in touch with basic programming.

  • @pybricks

    @pybricks

    5 ай бұрын

    You can totally do multi-trains on track, and even make them communicate wirelessly... See our other video for that. Possibilities are endless :)