Automate Your LEGO City Trains with Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ค. 2024
  • Subscribe 👉 bit.ly/subBlockParty
    Join 👉 bit.ly/joinBlockParty
    First time here? 👉 bit.ly/newToBlockParty
    As a former Computer Science teacher I love the idea of using code to automate my LEGO City, with the ultimate goal being to create the first "Smart Lego City" on TH-cam! Step one is using Python and Pybricks to automate my trains and trams. What should I try next?
    Check out our previous video here 👉 • Shopping at EVERY LEGO...
    The Pybricks tutorial I mentioned in the video 👉 • How to make smart Lego...
    Join our LEGO Discord here 👉 / discord
    Find our other channels here 👉 linktr.ee/lollujo
    For business enquiries, contact 👉 kevin.mgmt@ritualnetwork.com
    Links posted may be affiliate links.
    Automate Your LEGO City Trains with Python
    Automate Your LEGO City Trains with Python
    Automate Your LEGO City Trains with Python
    #LEGO #BlockParty #LegoCity

ความคิดเห็น • 58

  • @GuanoLad
    @GuanoLad 17 วันที่ผ่านมา +4

    My only advice is just a personal taste thing, in that the train seems too long for the space. I'd try to find a smaller one if I could. But you do you.

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา +1

      That train is only a placeholder until the new tram comes out in August

  • @same4308
    @same4308 17 วันที่ผ่านมา +4

    You should do a random wait time, say between 1 and 6 minutes under the platform to make it feel like a more realistic schedule of different train routes!

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา +3

      Excellent shout!

    • @danielwalters5819
      @danielwalters5819 17 วันที่ผ่านมา

      @@blockpartyukyou could also randomly choose the direction it goes when it stops underneath so it looks like trains are going both directions

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา

      That sounds like a plan

  • @EmperorKabir
    @EmperorKabir 17 วันที่ผ่านมา +2

    Massive fan of pybricks, I have a lengthy code for the Hogwarts express train that goes between hogsmeade and kings cross brick built mocs but it stops at the stations, accelerates gradually out of the stations based on a graph equation, runs at a top speed, decelerates into stations and waits at the station for a few minutes a time. Can also be controlled with the Lego controller. It also uses 2 motors that communicate with each other. My ultimate train code and great to bring out at Christmas. I don't have a Lego city but it's so great!

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา

      That sounds awesome!

  • @roybrien2062
    @roybrien2062 17 วันที่ผ่านมา +5

    The city is coming along nicely! Great vid as always

  • @TheSwedishOak
    @TheSwedishOak 2 วันที่ผ่านมา

    This is awesome stuff. LEGO trains that constant runs is just annoying but this is great.

  • @DuartJansen
    @DuartJansen 16 วันที่ผ่านมา

    This is actually really helpful for smaller cities, so the train hides for a couple of minutes before popping up again.

  • @steve230870
    @steve230870 12 วันที่ผ่านมา

    City is looking good, and loving the train, wish I had space for something like that.

  • @throughjulieseyes
    @throughjulieseyes 16 วันที่ผ่านมา

    Hi kevin be careful with the train stopping under the city it might get stuck, also when you do the beach can you people building sand castles somehow and is there a chance off some animals in the beach area would love too see some birds or maybe some fish in the sea area love seeing the great things you get up too enjoy look forward too seeing the finished piece

  • @macnavi
    @macnavi 15 วันที่ผ่านมา +1

    Exciting work! Looking forward to any updates on this subject.

  • @pybricks
    @pybricks 17 วันที่ผ่านมา

    Thanks for showcasing Pybricks! And thanks for becoming a supporter.
    Pro tip: try placing the sensor a bit closer to the track. It's quite a bit more reliable that way.
    You can tell it's about right when the colors at the top at 5:35 look almost like proper colors, rather than those darker shades.

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา

      I’ll have a play around, cheers!

  • @KingEurope1
    @KingEurope1 17 วันที่ผ่านมา

    The city is growing so fast, I love it!
    Great video as always Kev!

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา

      Yes! Thank you!

  • @StefanBishop-lu5kw
    @StefanBishop-lu5kw 17 วันที่ผ่านมา

    I would really like to see some videos about the coding, this is something I would like to do to my city! Great videos by the way!

  • @user-rq4iz5vg6l
    @user-rq4iz5vg6l 17 วันที่ผ่านมา

    IDEA: why don’t you program a random time delay for when it’s under the upper level? That way it would be extra special when it pops out! A nice little coding challenge too. Love the vids. All the best.

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา

      Definitely going to be adding that in, a few people have suggested it, it’s a great idea!

  • @MarkBuildsLego
    @MarkBuildsLego 17 วันที่ผ่านมา +1

    nicely done

  • @mhmm2930
    @mhmm2930 17 วันที่ผ่านมา

    Looks great! What made you change your mind about having the train go round the back on the bottom level? I know you were worried in case it derailed and you wouldn’t be able to access it

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา +1

      I decided to have the one of the top level shuttling back and forth and didn’t want them both doing the same thing. If it derails I’ll just have to move some stuff around!

  • @bengoldsmith5207
    @bengoldsmith5207 17 วันที่ผ่านมา

    Should make upper level of city into tramline instead of train, Good work so far 👍

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา

      I think the tram will be on the lower level because the track is already embedded into the road and the train that’s currently there will move to the upper level

  • @DanChurchman
    @DanChurchman 17 วันที่ผ่านมา

    You’ll be moving it all up into the loft soon!!

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา +1

      Now there’s an idea…

  • @simonwood3638
    @simonwood3638 17 วันที่ผ่านมา

    Can you make the delays random within specified limits so it waits for a minimum of 1 minute and a maximum of 2 minutes?

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา +1

      Yes, will look into doing that

  • @stevehumm1678
    @stevehumm1678 17 วันที่ผ่านมา

    Have sent to Bricksie, think he will love this!!

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา +2

      Well if he needs any help setting it up, I'm happy to go and be his little helper for a few days!

    • @stevehumm1678
      @stevehumm1678 17 วันที่ผ่านมา

      @@blockpartyuk I'll carry your bags!!

  • @johnconway4161
    @johnconway4161 17 วันที่ผ่านมา

    Very cool

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา +1

      It really is, I keep thinking of all the different possibilites now!

  • @simonmoss101
    @simonmoss101 17 วันที่ผ่านมา

    Would it be possible to have 2 trains under the platform. One on a linked siding so that when the first train stops the other one starts up and does its thing. This process would continue to alternate between the 2 trains. I know it would take up more room under the platform but it looks like you might have the space?

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา

      It’s definitely possible. I’ll have a ponder.

    • @pybricks
      @pybricks 17 วันที่ผ่านมา

      You can make the trains talk to each other so they can pass at a station: th-cam.com/video/n7kxz8-DZwA/w-d-xo.html

  • @thegaleforcerob
    @thegaleforcerob 17 วันที่ผ่านมา

    Probably a dumb question but do you need to keep your laptop on/ connected to the train for it to run? Can you just turn the train off and then on again and it'll keep running to your program?

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา +1

      Not a dumb question at all - I don’t actually know the answer!

    • @pybricks
      @pybricks 17 วันที่ผ่านมา +1

      You can! The Pybricks program is saved on the hub. So even with the PC off, you can just start the train again with the button on the hub. This is the biggest different with the official powered up app, where you can't do that.

  • @Kizza_Clips
    @Kizza_Clips 17 วันที่ผ่านมา

    Rodoror

  • @ZodiusInfuser
    @ZodiusInfuser 17 วันที่ผ่านมา

    Hey! I've been watching your channel since your Brick Fest video (shocked at how bad it was!). I hadn't realised you had a background in computer science! I work at a UK company that makes programmable electronics, and we have something coming up that may be of interest to you. Do you have any contact details?

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา +1

      Best way to contact me is the email address in my bio.

    • @ZodiusInfuser
      @ZodiusInfuser 17 วันที่ผ่านมา

      @@blockpartyuk Ah, thank you! It seems that detail is not visible on mobile, only on the desktop site

  • @Kizza_Clips
    @Kizza_Clips 17 วันที่ผ่านมา

    🤗😙😱😙😙😜

  • @Kizza_Clips
    @Kizza_Clips 17 วันที่ผ่านมา

    ,dlc,dl

  • @seanmacdermott2030
    @seanmacdermott2030 17 วันที่ผ่านมา

    I'm not best at computers. Is there a stupid gide

    • @blockpartyuk
      @blockpartyuk  17 วันที่ผ่านมา

      The video I linked to in the description is very step by step

  • @Kizza_Clips
    @Kizza_Clips 17 วันที่ผ่านมา

    Rlrkkrkfkrkf

  • @Kizza_Clips
    @Kizza_Clips 17 วันที่ผ่านมา

    Kekdkdk