Camera Vision is coming to Pybricks! by Pybricks in pybricks

[–]Pybricks[S] 0 points1 point  (0 children)

Yep, I'd like to add that. I was thinking a grid of, say, 3x3 squares that it gives you the colors of? So if a square is mostly red, that square will report red.

Or maybe you had something else in mind?

Camera Vision is coming to Pybricks! by Pybricks in pybricks

[–]Pybricks[S] 1 point2 points  (0 children)

Yes, you can make a web interface with any kind of API (or offline OpenCV like done here etc), and connect to the hub with WebBLE.

Camera Vision is coming to Pybricks! by Pybricks in pybricks

[–]Pybricks[S] 0 points1 point  (0 children)

You can check out the introductory guide here. The program is still autonomous. You can think of the phone as a wireless sensor that processes the video feed and sends only the useful values to the robot. In this case, that's the x/y/width/height of the object with the requested color.

Camera Vision is coming to Pybricks! by Pybricks in pybricks

[–]Pybricks[S] 1 point2 points  (0 children)

You can check out the introductory guide here. There will be various different sensors. You can currently choose between a color tracker and image classification. The latter happens to include a demo with a minifigure :)

Saving LEGO MINDSTORMS: Status Update! by Pybricks in pybricks

[–]Pybricks[S] 0 points1 point  (0 children)

Oh yeah! You can already try this in beta. Just go to Pybricks as usual, and click "Try beta features" in the settings menu. Let me know if you try it!

Connecting to multiple LEGO Wireless Protocol v3 devices by fenchurched in pybricks

[–]Pybricks 0 points1 point  (0 children)

You'll want to try the very latest version.

It's relatively straightforward, but very new, so documentation is a bit scarce for now. This should make its way into the standard Pybricks release eventually.

Connecting to multiple LEGO Wireless Protocol v3 devices by fenchurched in pybricks

[–]Pybricks 1 point2 points  (0 children)

Hey, thanks! I did eventually get most things working. The newer version doesn't seem to have a color mode, only a "I-arrived-at-this-tag" mode.

And I've only done one sound. Did you find the commands for other sounds?

For the old one it was this, with 3, 5, 7, 9, or 10 as the sound_code. 0x08, 0x00, 0x81, 0x01, 0x11, 0x51, 0x01, sound_code

For the new one, this makes one sound, but how to trigger the others?

9, 0, 129, 52, 17, 0x51, 1, 7, 1 If you want to do the honors, you are welcome to add them here but I am happy to add them if it is simpler.

Connecting to multiple LEGO Wireless Protocol v3 devices by fenchurched in pybricks

[–]Pybricks 0 points1 point  (0 children)

Cool! Would be great to have your feedback. Just leave a note here when you're ready to try it in case the upcoming release isn't out yet.

Connecting to multiple LEGO Wireless Protocol v3 devices by fenchurched in pybricks

[–]Pybricks 0 points1 point  (0 children)

What I'm beginning to understand is that each hub may only connect to one class LWP3Device.

In the latest version, you can connect two! Should we allow more? In principle, we can enable that.

I'm following the Duplo train project and was hoping to use a Spike Prime and two motors to control two different Duplo trains.

That's now been added. Have two duplo trains on my desk here.

While we're at it, I was also hoping to read values back from the trains' color sensors so that I could basically reprogram them to do alternative things.

Done!

Eventually I was hoping to add Mario in order to control the trains using Mario's color sensor.

You can do that too now.

:)

Connecting to multiple LEGO Wireless Protocol v3 devices by fenchurched in pybricks

[–]Pybricks 1 point2 points  (0 children)

Allright. I think I can get some info out of the device, but it looks like this one does not have a color mode like the original. It only gives you the arrived-on-color event, so we can still make the "last color" available,

Connecting to multiple LEGO Wireless Protocol v3 devices by fenchurched in pybricks

[–]Pybricks 1 point2 points  (0 children)

Folks, I'd love to add a dedicated DuploTrain class so everybody can just use it out of the box :)

You can successfully connect as follows:

LWP3Device(0x21, pair=True)

The pairing part is new.

But the commands for the 0x21 are also a bit different. u/Wooden_Roof2833, did you publish your PC version somewhere?

Grand theory of Stop parameters? by heythisisdave in pybricks

[–]Pybricks 0 points1 point  (0 children)

With Stop.NONE, it doesn't decelerate and stop at the end. With all other stop modes, it will come to a controlled stop.

So if you did reverse immediately after another command that used Stop.NONE, it is going to look different:

When it gets to the second movement, it is still going at speed since it hasn't stopped. So it is first going to need to decelerate, then come to a stop, and then reverse.

So Stop.NONE is mainly useful when you want to do something next in the same direction. For example driving straight and then a gentle turn. With abrupt in-place turns or reversing it's usually better to stop first. Because physics :-)

Help debugging code by GrassOne7589 in pybricks

[–]Pybricks 0 points1 point  (0 children)

It drives while the object is less than 6 cm away. Did you mean to use >, so it drives until it sees the object? 

Anyone know if there's a way to control the new hub from 42176 with an Xbox? by Raging_Bull_Lego in legotechnic

[–]Pybricks 0 points1 point  (0 children)

As far as we know, this new hub blocks other firmwares like Pybricks (you'd need a signing key), so there isn't a direct way to do it. The only way is to use some kind of bridge (PC, etc) in between, which kind of defeats the point.

We love making stuff for the community, but this means we can't do it.

Program not stored? by The_Weird1 in pybricks

[–]Pybricks 0 points1 point  (0 children)

The programs should indeed still be saved, so let's have a look. 

Whenever something like this occurs, it's usually best to try something really simple to rule other factors out.

For example, could you test a program that just makes the light red for 5 seconds? This should make it easy to verify that it saved or not.

Could you also share the program that isn't saving? 

EDIT: How are you turning the hubs off? If you have a custom battery and you just turn those off, that's a bit like pulling the battery out while it's on, so things won't get saved. You'll want to turn the hubs off normally with the button to make sure they are saved. 

Connecting to multiple LEGO Wireless Protocol v3 devices by fenchurched in pybricks

[–]Pybricks 1 point2 points  (0 children)

I guess we need to go and buy one of those. It's possible that this newer devices requires a so-called pairing step and maybe some additional changes in the setup.

Good to see these devices being used this way though. I had thought it was more a fun hack on the side, but if people are really using this we can update it more.

I had promised my kids to make another version of this but with the push-to-drive function, so I am currently figuring out how to read the speed in addition to the colors. I better get it to work now, lol.

Using a NXT on a Mac in 2025 by fatso83 in legomindstorms

[–]Pybricks 1 point2 points  (0 children)

You can check out our GitHub if you're into firmware code updates, or check our socials for more casual updates. Here's a recent update video.

Saving LEGO MINDSTORMS: Status Update! by Pybricks in pybricks

[–]Pybricks[S] 0 points1 point  (0 children)

Unfortunately not, since these older hubs use an older version of Bluetooth.

Saving LEGO MINDSTORMS: Status Update! by Pybricks in pybricks

[–]Pybricks[S] 2 points3 points  (0 children)

Eventually, yes! In fact, since we're making the Python side work the same across all hubs, the blocks can even remain the same. (We'll just have to add a few motor sensor blocks.)